From 2777e0d64152dace9c5307cd07bd8e13c6f6631e Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 3 Jul 2023 10:05:40 +0700 Subject: cart mobile --- src/lib/cart/components/Cart.jsx | 210 +++++++++++++++++++++++++-------------- 1 file changed, 138 insertions(+), 72 deletions(-) (limited to 'src/lib/cart') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index 0cbcacd8..45f2f770 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -256,85 +256,151 @@ const Cart = () => { )} - {products?.map((product) => ( -
- toggleSelected(product.id)} - checked={product?.selected} - className='mr-2 accent-danger-500 w-4' - /> - - - {product?.name} - -
- - {product?.parent?.name} - -
- {product?.code}{' '} - {product?.attributes.length > 0 ? `| ${product?.attributes.join(', ')}` : ''} -
- {product?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.price?.price)} + {products && + products?.map((product) => ( + <> + {product.isPromo > 0 && ( +
+ {product.program ? ( + <> +
+ {product.program.type.label} +
+
+ {product.program.type.value == 'merchandise' ? ( + <>Selamat anda mendapatkan merchandise indoteknik.com + ) : ( + <> + Selamat! Pembelian anda lebih hemat + + {' '} + {currencyFormat(product.program.price.priceDiscount)} + + + )} +
+ + ) : ( + <> +
+ Promo +
+
Pilih Promo Yang Tersedia Bisa lebih Hemat
+ + )} +
+ handlePopUpPromo(product.id, product.quantity, product.program?.id) + } + className='ml-auto text-red-500 flex gap-x-1 cursor-pointer' + > +
Cek Promo
+
+ +
-
{product?.price?.discountPercentage}%
)} -
- {currencyFormat(product?.price?.priceDiscount)} -
-
-
- {currencyFormat(product?.price?.priceDiscount * product?.quantity)} -
-
- - updateQuantity(e.target.value, product?.id)} - onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} +
+ toggleSelected(product.id)} + checked={product?.selected} + className='mr-2 accent-danger-500 w-4' + /> + + + {product?.name} - - + {product?.parent?.name} + +
+ {product?.code}{' '} + {product?.attributes.length > 0 + ? `| ${product?.attributes.join(', ')}` + : ''} +
+ {product?.price?.discountPercentage > 0 && ( +
+
+ {currencyFormat(product?.price?.price)} +
+
+ {product?.price?.discountPercentage}% +
+
+ )} +
+ {currencyFormat(product?.price?.priceDiscount)} +
+
+
+ {currencyFormat(product?.price?.priceDiscount * product?.quantity)} +
+
+ + updateQuantity(e.target.value, product?.id)} + onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} + /> + + +
+
-
-
- ))} + + ))}
-- cgit v1.2.3