From e72c16eb549488e1ed847b022880f542d2a9c525 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 5 Oct 2023 09:32:12 +0700 Subject: add component list product for cart, quotation, and checkout --- src/lib/cart/components/Cart.jsx | 257 +-------------------------------------- 1 file changed, 3 insertions(+), 254 deletions(-) (limited to 'src/lib/cart') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index 5716d01b..c6aaa596 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -23,6 +23,8 @@ import { getPromotionProgram } from '@/lib/promotinProgram/api/homepageApi' import PromotionType from '@/lib/promotinProgram/components/PromotionType' import { gtagBeginCheckout } from '@/core/utils/googleTag' import { useProductCartContext } from '@/contexts/ProductCartContext' +import CardProdcuctsList from '@/core/components/elements/Product/cartProductsList' +// import cardProdcuctsList from '@/core/components/elements/Product/cartProductsList' const Cart = () => { const router = useRouter() @@ -530,260 +532,7 @@ const Cart = () => {

Keranjang

- - - - - - - - - - - - {isLoading && ( - - - - )} - {!isLoading && (!products || products?.length == 0) && ( - - - - )} - {products && - products?.map((product) => ( - <> - {product.hasProgram && ( - - - - )} - - - - - - - - - {product?.program?.items && ( - - {product.program.items.map((item) => ( - <> - - - - - - - - ))} - - )} - - ))} - -
Nama ProdukJumlahHargaSubtotalAction
-
- -
-
Keranjang belanja anda masih kosong
-
- {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?.totalSavings)} - - - )} -
- - ) : ( - <> -
- 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
-
- -
-
-
-
- - toggleSelected(product.id)} - checked={product?.selected} - className='accent-danger-500 w-4' - /> - - - - {product?.name} - -
- - {product?.parent?.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?.hasFlashsale ? ( - <> -
-
- {currencyFormat(product?.price?.price)} -
-
- {product?.price?.discountPercentage}% -
-
-
- {currencyFormat(product?.price?.priceDiscount)} -
- - ) : ( -
- {currencyFormat(product?.price?.price)} -
- )} -
- -
- {currencyFormat(product?.price?.priceDiscount * product?.quantity)} -
-
-
- -
-
- - - -
- {item.name} -
-
-
- - {product.program.type.label} - -
-
{item.name}
-
-
- - - - - {item?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.price?.price)} -
-
- )} -
- {item?.price.priceDiscount > 0 ? 'Gratis' : ''} -
-
- -
- {item.price.priceDiscount > 0 ? 'Gratis' : ''} -
-
+