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

---
 .../product/components/Product/ProductDesktop.jsx  | 74 +++++++++++++++-------
 1 file changed, 50 insertions(+), 24 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx
index 5cc35df7..0df60673 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -413,13 +413,13 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
               <div className='text-gray_r-12/80'>Harga mulai dari: </div>
             )}
 
-            {lowestPrice?.discountPercentage > 0 && (
+            {/* {lowestPrice?.discountPercentage > 0 && (
               <div className='flex gap-x-1 items-center mt-2'>
                 <div className='badge-solid-red text-caption-1'>
                   {lowestPrice?.discountPercentage}%
                 </div>
-                <div className='text-gray_r-11 line-through text-caption-1'>
-                  {currencyFormat(lowestPrice?.price)}
+                <div className='text-gray_r-9 text-caption-1'>
+                  Include PPN {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)}
                 </div>
                 {product.flashSale.remainingTime > 0 && (
                   <div className='bg-red-600 rounded-full mb-1 p-2 pl-3 pr-3 flex w-fit items-center gap-x-1'>
@@ -436,28 +436,54 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                   </div>
                 )}
               </div>
+            )} */}
+
+            {product?.flashSale?.remainingTime > 0 ? (
+              <>
+                <div className='flex gap-x-1 items-center mt-2'>
+                  <div className='badge-solid-red text-caption-1'>
+                    {lowestPrice?.discountPercentage}%
+                  </div>
+                  <div className='text-gray_r-9 line-through text-caption-1'>
+                    {currencyFormat(lowestPrice?.price)}
+                  </div>
+                  <div className='text-danger-500 font-semibold text-xl'>
+                    {currencyFormat(lowestPrice?.priceDiscount)}
+                  </div>
+                </div>
+                <div className='text-gray_r-9 text-base font-normal mt-1'>
+                  Termasuk PPN: {currencyFormat(lowestPrice?.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
+                </div>
+              </>
+            ) : (
+              <h3 className='text-danger-500 font-semibold mt-1 text-title-md'>
+                {lowestPrice?.price > 0 ? (
+                  <>
+                    {currencyFormat(lowestPrice?.price)}
+                    <div className='text-gray_r-9 text-base font-normal mt-1'>
+                      Termasuk PPN: {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)}
+                    </div>
+                  </>
+                ) : (
+                  <span className='text-gray_r-12/90 font-normal text-h-sm'>
+                    Hubungi kami untuk dapatkan harga terbaik,&nbsp;
+                    <a
+                      href={whatsappUrl('product', {
+                        name: product.name,
+                        manufacture: product.manufacture?.name,
+                        url: createSlug('/shop/product/', product.name, product.id, true)
+                      })}
+                      className='text-danger-500 underline'
+                      rel='noopener noreferrer'
+                      target='_blank'
+                    >
+                      klik disini
+                    </a>
+                  </span>
+                )}
+              </h3>
             )}
-            <h3 className='text-danger-500 font-semibold mt-1 text-title-md'>
-              {lowestPrice?.priceDiscount > 0 ? (
-                currencyFormat(lowestPrice?.priceDiscount)
-              ) : (
-                <span className='text-gray_r-12/90 font-normal text-h-sm'>
-                  Hubungi kami untuk dapatkan harga terbaik,&nbsp;
-                  <a
-                    href={whatsappUrl('product', {
-                      name: product.name,
-                      manufacture: product.manufacture?.name,
-                      url: createSlug('/shop/product/', product.name, product.id, true)
-                    })}
-                    className='text-danger-500 underline'
-                    rel='noopener noreferrer'
-                    target='_blank'
-                  >
-                    klik disini
-                  </a>
-                </span>
-              )}
-            </h3>
+
             {product.variants.length > 1 ? (
               <button
                 type='button'
-- 
cgit v1.2.3

