From ead27f576ea73bb4625fea839ee78c4a8db0d4e9 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 6 Jul 2023 10:21:50 +0700 Subject: variant page --- .../product/components/Product/ProductDesktop.jsx | 3 ++- .../product/components/Product/ProductMobile.jsx | 24 +++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src/lib/product') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 946529ce..e15ea252 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -84,7 +84,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { programLineId: product.variants[variantIndex].programActive, selected: true }) - }{ + }else{ updateItemCart({ productId: variantId, quantity, @@ -202,6 +202,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => { setPromotionActiveId={setPromotionActiveId} promotionActiveId={promotionActiveId} quantity={quantityActive} + product={product} > diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 2090d324..f3afa938 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -41,7 +41,8 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { name: product.name, price: getLowestPrice(), stock: product.stockTotal, - weight: product.weight + weight: product.weight, + hasProgram: false }) const variantOptions = product.variants?.map((variant) => ({ @@ -69,7 +70,8 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { name: variant.parent.name + variantAttributes, price: variant.price, stock: variant.stock, - weight: variant.weight + weight: variant.weight, + hasProgram: variant.hasProgram }) } }, [selectedVariant, product]) @@ -190,14 +192,16 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { isSearchable={product.variantTotal > 10} /> -
- -
+ {activeVariant.hasProgram && ( +
+ +
+ )}
Jumlah
-- cgit v1.2.3