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/ProductDesktopVariant.jsx   | 71 ++++++++++++----------
 1 file changed, 40 insertions(+), 31 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index d64e70c2..51739bc9 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -203,7 +203,8 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
                       <a
                         href={whatsappUrl('product', {
                           name: product.name,
-                          url: createSlug('/shop/product/variant/', product.name, product.id, true)
+                            manufacture: product?.manufacture?.name,
+                            url: createSlug('/shop/product/', product.name, product.id, true)
                         })}
                         className='text-danger-500 font-medium'
                       >
@@ -269,44 +270,52 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
             </div> */}
           </div>
           <div className='w-[25%]'>
-            {lowestPrice?.priceDiscount > 0 ? (
+            {product?.flashSale?.remainingTime > 0 ? (
               <>
-                <div className='flex gap-x-2 mb-3 items-center'>
-                  <div className='flex'>
-                    <span className='text-gray-400 text-md'>Harga Sebelum PPN : </span>
-                  </div>
-                  <div className='flex'>
-                    <span className=' text-body-1 '>
-                      {currencyFormat(lowestPrice?.priceDiscount)}
-                    </span>
-                  </div>
-                </div>
-                <span className='font-semibold'>Termasuk PPN :</span>
-                <div className='flex gap-x-1 items-center mt-2 '>
+                <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 * 1.11)}
+                  <div className='text-gray_r-9 line-through text-caption-1'>
+                    {currencyFormat(lowestPrice?.price)}
                   </div>
-                  <h3 className='text-danger-500 font-semibold text-title-sm'>
-                    {currencyFormat(lowestPrice?.priceDiscount * 1.11)}
-                  </h3>
+                  <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>
               </>
             ) : (
-              <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,
-                    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 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>
             )}
             <div className='flex gap-x-3 mt-4'>
               <input
-- 
cgit v1.2.3

