diff options
Diffstat (limited to 'src/lib/product/components')
| -rw-r--r-- | src/lib/product/components/Product/ProductDesktop.jsx | 4 | ||||
| -rw-r--r-- | src/lib/product/components/Product/ProductMobile.jsx | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 507d676c..d15e84d1 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -423,7 +423,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { <ProductSimilar query={productSimilarQuery} /> </LazyLoad> </div> - {/* <BottomPopup + <BottomPopup className=' !h-[75%]' title='Pakai Promo' active={promotionType} @@ -432,7 +432,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { <div className='flex mt-4'> <PromotionType isModal={true} ></PromotionType> </div> - </BottomPopup> */} + </BottomPopup> <BottomPopup className='!container' title='Berhasil Ditambahkan' diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 4da237ed..2090d324 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -24,6 +24,9 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { const [informationTab, setInformationTab] = useState(informationTabOptions[0].value) const [addCartAlert, setAddCartAlert] = useState(false) + const [promotionType, setPromotionType] = useState(false) + const [promotionActiveId, setPromotionActiveId] = useState(null) + const getLowestPrice = () => { const prices = product.variants.map((variant) => variant.price) const lowest = prices.reduce((lowest, price) => { @@ -89,6 +92,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { updateItemCart({ productId: activeVariant.id, quantity, + programLineId: promotionActiveId, selected: true }) setAddCartAlert(true) @@ -187,7 +191,12 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { /> </div> <div className='mt-5'> - <PromotionType></PromotionType> + <PromotionType + variantId={product.variants[0].id} + setPromotionActiveId={setPromotionActiveId} + promotionActiveId={promotionActiveId} + quantity={quantity} + ></PromotionType> </div> <div className='mt-4 mb-2'>Jumlah</div> |
