From ead27f576ea73bb4625fea839ee78c4a8db0d4e9 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Thu, 6 Jul 2023 10:21:50 +0700
Subject: variant page

---
 .../product/components/Product/ProductMobile.jsx   | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

(limited to 'src/lib/product/components/Product/ProductMobile.jsx')

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'>
-- 
cgit v1.2.3

