From 0c74635521471e3d67c434a7df9cd9c61bbcaa72 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 6 Oct 2023 14:09:55 +0700
Subject: fixing discount presentage

---
 src/lib/product/components/Product/ProductDesktop.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(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 4c8c3ae9..55878a93 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -216,7 +216,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                       <div className='flex gap-x-2 items-center p-2'>
                         <div className='bg-yellow-400 rounded-full p-1 h-9 w-20 flex items-center justify-center '>
                           <span className='text-lg font-bold'>
-                            {product.lowestPrice.discountPercentage}%
+                            {Math.floor(product.lowestPrice.discountPercentage)}%
                           </span>
                         </div>
                         <div
-- 
cgit v1.2.3


From 2ac1c3a84032ba819046e1634ca7c46ac0521e3b Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 6 Oct 2023 15:19:54 +0700
Subject: add condisi if harga tier user lebih rendah dari flash sale

---
 src/lib/product/components/Product/ProductDesktop.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 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 55878a93..cc3cf666 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -203,7 +203,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
           <div className='w-full flex flex-wrap'>
             <div className='w-5/12'>
               <div className='relative mb-2'>
-                {product?.flashSale?.remainingTime > 0 && (
+                {product?.flashSale?.remainingTime > 0 && lowestPrice?.price.discountPercentage > 0 && (
                   <div className={`absolute bottom-0 w-full`}>
                     <div className='absolute bottom-0 w-full h-full'>
                       <ImageNext
@@ -441,7 +441,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
               </div>
             )} */}
 
-            {lowestPrice?.isFlashsale ? (
+            {lowestPrice?.isFlashsale && lowestPrice?.price.discountPercentage > 0 ? (
               <>
                 <div className='flex gap-x-1 items-center mt-2'>
                   <div className='badge-solid-red text-caption-1'>
-- 
cgit v1.2.3


From f0fd9b94ad84b71a5a38d212f777eff609e62438 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 6 Oct 2023 15:28:51 +0700
Subject: bugfix list variant

---
 src/lib/product/components/Product/ProductDesktop.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 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 cc3cf666..47e98c1a 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -49,7 +49,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
       isFlashsale: variant.isFlashsale
     }))
     const lowest = prices.reduce((lowest, price) => {
-      return price.priceDiscount < lowest.priceDiscount ? price : lowest
+      return price.price < lowest.price ? price : lowest
     }, prices[0])
     return lowest
   }, [product])
@@ -580,7 +580,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                         <ColumnsSLA variant={variant} product={product} />
                       </LazyLoadComponent>
                       <td>
-                        {variant.isFlashsale ? (
+                        {variant.isFlashsale && variant?.price?.discountPercentage > 0 ? (
                           <>
                             <div className='flex items-center gap-x-1 justify-center'>
                               <div className='badge-solid-red text-caption-1'>
@@ -610,7 +610,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                                 <div className=' text-caption-1 text-gray_r-11 mb-1'>
                                   Inc. PPN:{' '}
                                   {currencyFormat(
-                                    variant?.price?.priceDiscount * process.env.NEXT_PUBLIC_PPN
+                                    variant?.price?.price * process.env.NEXT_PUBLIC_PPN
                                   )}
                                 </div>
                               </>
-- 
cgit v1.2.3

