From d793056d1645c221d02fb821e34ab2c435c387d0 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 13 Nov 2025 16:20:23 +0700 Subject: product variant --- .../components/Product/ProductMobileVariant.jsx | 281 +++++++++++---------- 1 file changed, 143 insertions(+), 138 deletions(-) (limited to 'src/lib/product/components/Product/ProductMobileVariant.jsx') diff --git a/src/lib/product/components/Product/ProductMobileVariant.jsx b/src/lib/product/components/Product/ProductMobileVariant.jsx index 4cfc63ca..e6c2204b 100644 --- a/src/lib/product/components/Product/ProductMobileVariant.jsx +++ b/src/lib/product/components/Product/ProductMobileVariant.jsx @@ -183,10 +183,20 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { return ( - {/* PRICE & ACTIONS: tetap punyamu, hanya hapus input number lama */} - {/* ===== BAR BAWAH (fixed) ===== */} +
+ {!product.price.price > 0 && ( +
+ Produk tidak tersedia +
+ )} +
+ {/* ===== BAR BAWAH ===== */}
- {/* HARGA & PPN (logikamu tetap) */} + {/* HARGA & PPN */} {activeVariant.isFlashSale && activeVariant?.price?.discountPercentage > 0 ? ( <> @@ -220,80 +230,65 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { )}
- ) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - - )} + ) : null} )} - {/* ⬇️ TAMBAHKAN BLOK INI DI DALAM BAR: STOK & STEPPER */}
-
-
- {/* Stock : {activeVariant?.stock ?? 0} */} - Stock : {fakeStock}{' '} -
- {qtyPickUp > 0 && ( -
- * {qtyPickUp} barang bisa di pickup + {product?.price?.price > 0 && ( +
+
+ {/* Stock : {activeVariant?.stock ?? 0} */} + Stock : {fakeStock}{' '}
- )} -
+ {qtyPickUp > 0 && ( +
+ * {qtyPickUp} barang bisa di pickup +
+ )} +
+ )}
-
- - setQuantityInput(e.target.value)} - className='h-10 w-16 text-center text-lg outline-none border-x + {product?.price?.price > 0 && ( +
+ + setQuantityInput(e.target.value)} + className='h-10 w-16 text-center text-lg outline-none border-x [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none' - /> - -
+ /> + +
+ )}
@@ -306,6 +301,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { className='flex items-center justify-center p-2 border-2 hover:bg-slate-100' variant='outline' title='Lihat Dokumen' + isDisabled={product?.price?.price <= 0} > { className='flex-1' colorScheme='red' variant='outline' - isDisabled={product.stock === 0} + isDisabled={product?.price?.price <= 0} > Keranjang @@ -333,7 +329,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { } className='flex-1' colorScheme='red' - isDisabled={product.stock === 0} + isDisabled={product?.price?.price <= 0} > Beli @@ -396,87 +392,92 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { active={informationTab == 'specification'} className='rounded border border-gray_r-6 divide-y divide-gray_r-6' > - - - {isLoadingSLA ? ( - - ) : product?.sla?.slaDate != '-' ? ( -
-
- -
- - ) : ( - '-' - )} - - + {product?.sla?.slaDate} + +
+ +
+ + ) : ( + '-' + )} + + + )} + SKU-{product?.id} {activeVariant?.code || '-'} - - {activeVariant?.stock > 0 && ( - -
Ready Stock
-
- {activeVariant?.stock > 5 ? '> 5' : '< 5'} -
-
- )} - {activeVariant?.stock == 0 && ( - - Tanya Stok - - )} -
+ {product?.price?.price > 0 && ( + + {activeVariant?.stock > 0 && ( + +
Ready Stock
+
+ {activeVariant?.stock > 5 ? '> 5' : '< 5'} +
+
+ )} + {activeVariant?.stock == 0 && ( + + Tanya Stok + + )} +
+ )} - {activeVariant?.weight > 0 && ( + {activeVariant?.weight > -1 && ( {activeVariant?.weight} KG )} - {activeVariant?.weight == 0 && ( + {activeVariant?.weight == -1 && ( { true ), })} - className='text-danger-500 font-medium' + className={`text-danger-501 font-medium ${ + !product?.price?.price || product?.price?.price <= 0 + ? 'pointer-events-none opacity-50 cursor-default' + : '' + }`} > Tanya Berat -- cgit v1.2.3 From 48c1110541a30bb33726a6f46737615b98f1d9c5 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 13 Nov 2025 17:13:53 +0700 Subject: Fix eror --- src/lib/product/components/Product/ProductMobileVariant.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/product/components/Product/ProductMobileVariant.jsx') diff --git a/src/lib/product/components/Product/ProductMobileVariant.jsx b/src/lib/product/components/Product/ProductMobileVariant.jsx index e6c2204b..0f4953df 100644 --- a/src/lib/product/components/Product/ProductMobileVariant.jsx +++ b/src/lib/product/components/Product/ProductMobileVariant.jsx @@ -189,7 +189,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { Produk tidak tersedia )} -- cgit v1.2.3