summaryrefslogtreecommitdiff
path: root/src/lib/product/components/Product
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-06 10:21:50 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-06 10:21:50 +0700
commitead27f576ea73bb4625fea839ee78c4a8db0d4e9 (patch)
tree24c31b02f1183a623b39118c13d63dce4c474b16 /src/lib/product/components/Product
parentcb69cf4e6633bb9192cd7bdc0a0063541f67102f (diff)
variant page
Diffstat (limited to 'src/lib/product/components/Product')
-rw-r--r--src/lib/product/components/Product/ProductDesktop.jsx3
-rw-r--r--src/lib/product/components/Product/ProductMobile.jsx24
2 files changed, 16 insertions, 11 deletions
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}
></PromotionType>
</div>
</div>
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}
/>
</div>
- <div className='mt-5'>
- <PromotionType
- variantId={product.variants[0].id}
- setPromotionActiveId={setPromotionActiveId}
- promotionActiveId={promotionActiveId}
- quantity={quantity}
- ></PromotionType>
- </div>
+ {activeVariant.hasProgram && (
+ <div className='mt-5'>
+ <PromotionType
+ variantId={product.variants[0].id}
+ setPromotionActiveId={setPromotionActiveId}
+ promotionActiveId={promotionActiveId}
+ quantity={quantity}
+ ></PromotionType>
+ </div>
+ )}
<div className='mt-4 mb-2'>Jumlah</div>
<div className='flex gap-x-3'>