From 787d3aaa3187d3432c8e6b743b555ea3e4a4980c Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 3 Oct 2023 15:25:14 +0700
Subject: new pricelist di page product cart, product detail & product variant

---
 .../components/Product/ProductMobileVariant.jsx    | 73 +++++++++++-----------
 1 file changed, 38 insertions(+), 35 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 d0c209cc..a7b1a543 100644
--- a/src/lib/product/components/Product/ProductMobileVariant.jsx
+++ b/src/lib/product/components/Product/ProductMobileVariant.jsx
@@ -39,7 +39,8 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
     name: product.name,
     price: getLowestPrice(),
     stock: product.stockTotal,
-    weight: product.weight
+    weight: product.weight,
+    isFlashSale: product.isFlashsale
   })
 
   useEffect(() => {
@@ -50,7 +51,8 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
         name: product.name,
         price: product.price,
         stock: product.stock,
-        weight: product.weight
+        weight: product.weight,
+        isFlashSale: product.isFlashsale
       })
     }
   }, [selectedVariant, product])
@@ -80,6 +82,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
     })
     setAddCartAlert(true)
   }
+  console.log('ini log', activeVariant)
 
   const handleClickBuy = () => {
     if (!validAction()) return
@@ -139,47 +142,47 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
         </div>
         <h1 className='leading-6 font-medium mb-3'>{activeVariant?.name}</h1>
 
-        {activeVariant?.price?.priceDiscount > 0 ? (
+        {activeVariant.isFlashsale ? (
           <>
             <div className='flex gap-x-1 items-center'>
-              <div className='text-gray_r-11 text-caption-1'>Harga Sebelum PPN :</div>
-              <div className='text-gray_r-12 line-through text-caption-1'>
-                {' '}
+              <div className='badge-solid-red'>{activeVariant?.price?.discountPercentage}%</div>
+              <div className='text-gray_r-11 line-through text-caption-1'>
+                {currencyFormat(activeVariant?.price?.price)}
+              </div>
+              <div className='text-danger-500 font-semibold'>
                 {currencyFormat(activeVariant?.price?.priceDiscount)}
               </div>
             </div>
-            <div className='mt-2'>
-              <span className='font-semibold '>Termasuk PPN :</span>
-              <div className='flex gap-x-2 items-center mt-2'>
-                {activeVariant?.price?.discountPercentage > 0 && (
-                  <>
-                    <div className='badge-solid-red'>
-                      {activeVariant?.price?.discountPercentage}%
-                    </div>
-                    <div className='text-gray_r-11 line-through text-caption-1'>
-                      {currencyFormat(activeVariant?.price?.price * 1.11)}
-                    </div>
-                  </>
-                )}
-                <h3 className='text-danger-500 font-semibold'>
-                  {currencyFormat(activeVariant?.price?.priceDiscount * 1.11)}
-                </h3>
-              </div>
+            <div className='text-gray_r-9 text-base font-normal mt-1'>
+              Termasuk PPN:{' '}
+              {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
             </div>
           </>
         ) : (
-          <span className='text-gray_r-11 leading-6 font-normal'>
-            Hubungi kami untuk dapatkan harga terbaik,&nbsp;
-            <a
-              href={whatsappUrl('product', {
-                name: product.name,
-                url: createSlug('/shop/product/', product.name, product.id, true)
-              })}
-              className='text-danger-500 underline'
-            >
-              klik disini
-            </a>
-          </span>
+          <h3 className='text-danger-500 font-semibold mt-1'>
+            {activeVariant?.price?.priceDiscount > 0 ? (
+              <>
+                {currencyFormat(activeVariant?.price?.priceDiscount)}
+                <div className='text-gray_r-9 text-base font-normal mt-1'>
+                  Termasuk PPN:{' '}
+                  {currencyFormat(activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
+                </div>
+              </>
+            ) : (
+              <span className='text-gray_r-11 leading-6 font-normal'>
+                Hubungi kami untuk dapatkan harga terbaik,&nbsp;
+                <a
+                  href={whatsappUrl('product', {
+                    name: product.name,
+                    url: createSlug('/shop/product/', product.name, product.id, true)
+                  })}
+                  className='text-danger-500 underline'
+                >
+                  klik disini
+                </a>
+              </span>
+            )}
+          </h3>
         )}
       </div>
 
-- 
cgit v1.2.3


From eb7bea2f262ffa4faa39d4f163950892c5640c0f Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 4 Oct 2023 10:09:43 +0700
Subject: pricelist di cart dan list variant

---
 src/lib/product/components/Product/ProductMobileVariant.jsx | 1 -
 1 file changed, 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 a7b1a543..8cdb631f 100644
--- a/src/lib/product/components/Product/ProductMobileVariant.jsx
+++ b/src/lib/product/components/Product/ProductMobileVariant.jsx
@@ -82,7 +82,6 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
     })
     setAddCartAlert(true)
   }
-  console.log('ini log', activeVariant)
 
   const handleClickBuy = () => {
     if (!validAction()) return
-- 
cgit v1.2.3

