From 84ae09f61f05f212ec098da1fd4ed14960119527 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 27 Jun 2023 09:07:22 +0700 Subject: promotion detail --- src/lib/cart/components/Cart.jsx | 155 +++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 72 deletions(-) (limited to 'src/lib/cart/components') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index a9113e75..cfbc3989 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -46,7 +46,7 @@ const Cart = () => { setCart(listCart) } cart() - },[]) + }, []) useEffect(() => { if (cart) { @@ -350,89 +350,100 @@ const Cart = () => { )} {products && products?.map((product) => ( - - - toggleSelected(product.id)} - checked={product?.selected} - className='accent-danger-500 w-4' - /> - - - - {product?.name} + + +
+
Promo
+
Pilih Promo Yang Tersedia Bisa lebih Hemat
+
Cek Promo
+
+ + + + + toggleSelected(product.id)} + checked={product?.selected} + className='accent-danger-500 w-4' /> - -
+ + - {product?.parent?.name} + {product?.name} -
- {product?.code}{' '} - {product?.attributes.length > 0 - ? `| ${product?.attributes.join(', ')}` - : ''} -
-
- - - updateQuantity(e.target.value, product?.id)} - onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} - /> - - - {product?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.price?.price)} +
+ + {product?.parent?.name} + +
+ {product?.code}{' '} + {product?.attributes.length > 0 + ? `| ${product?.attributes.join(', ')}` + : ''}
-
- {product?.price?.discountPercentage}% +
+ + + updateQuantity(e.target.value, product?.id)} + onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} + /> + + + {product?.price?.discountPercentage > 0 && ( +
+
+ {currencyFormat(product?.price?.price)} +
+
+ {product?.price?.discountPercentage}% +
+ )} +
+ {currencyFormat(product?.price?.priceDiscount)}
- )} -
- {currencyFormat(product?.price?.priceDiscount)} -
- - -
- {currencyFormat(product?.price?.priceDiscount * product?.quantity)} -
- - -
- -
- - + + +
+ {currencyFormat(product?.price?.priceDiscount * product?.quantity)} +
+ + +
+ +
+ + + ))} -- cgit v1.2.3