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

---
 .../product/components/Product/ProductDesktop.jsx  | 64 ++++++++++++++--------
 1 file changed, 42 insertions(+), 22 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 0df60673..30424943 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -452,7 +452,8 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                   </div>
                 </div>
                 <div className='text-gray_r-9 text-base font-normal mt-1'>
-                  Termasuk PPN: {currencyFormat(lowestPrice?.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
+                  Termasuk PPN:{' '}
+                  {currencyFormat(lowestPrice?.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
                 </div>
               </>
             ) : (
@@ -461,7 +462,8 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                   <>
                     {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)}
+                      Termasuk PPN:{' '}
+                      {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)}
                     </div>
                   </>
                 ) : (
@@ -575,32 +577,50 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                         <ColumnsSLA variant={variant} product={product} />
                       </LazyLoadComponent>
                       <td>
-                        {variant.price.discountPercentage > 0 &&
+                        {variant.isFlashsale ? (
+                          <>
+                            <div className='flex items-center gap-x-1 justify-center'>
+                              <div className='badge-solid-red text-caption-1'>
+                                {lowestPrice?.discountPercentage}%
+                              </div>
+                              <div className='line-through text-caption-1 text-gray_r-11'>
+                                {currencyFormat(variant.price.price)}
+                              </div>{' '}
+                              <div className=' text-caption-1 text-red-600 font-semibold'>
+                                {currencyFormat(variant.price.priceDiscount)}
+                              </div>{' '}
+                            </div>
+                            {currencyFormat(variant.price.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
+                          </>
+                        ) : (
+                          <div>
+                            {variant.price.price > 0 ? (
+                              currencyFormat(variant.price.price * process.env.NEXT_PUBLIC_PPN)
+                            ) : (
+                              <a
+                                href={whatsappUrl('product', {
+                                  name: variant.name,
+                                  manufacture: product.manufacture?.name,
+                                  url: createSlug('/shop/product/', product.name, product.id, true)
+                                })}
+                                className='text-red_r-11'
+                                rel='noopener noreferrer'
+                                target='_blank'
+                              >
+                                Call for price
+                              </a>
+                            )}
+                          </div>
+                        )}
+                        {/* {variant.price.discountPercentage > 0 &&
                           variant.price.priceDiscount > 0 && (
                             <>
                               <div className='line-through text-caption-1 text-gray_r-11 mb-1'>
                                 {currencyFormat(variant.price.price)}
                               </div>{' '}
                             </>
-                          )}
-                        <div>
-                          {variant.price.priceDiscount > 0 ? (
-                            currencyFormat(variant.price.priceDiscount)
-                          ) : (
-                            <a
-                              href={whatsappUrl('product', {
-                                name: variant.name,
-                                manufacture: product.manufacture?.name,
-                                url: createSlug('/shop/product/', product.name, product.id, true)
-                              })}
-                              className='text-red_r-11'
-                              rel='noopener noreferrer'
-                              target='_blank'
-                            >
-                              Call for price
-                            </a>
-                          )}
-                        </div>
+                          )} */}
+
                         {/* <VariantPrice id={variant.id} /> */}
                       </td>
                       <td>
-- 
cgit v1.2.3

