From 4ea9fbdcdf1c6625204bbaea9c4b117febf0a212 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 13 Nov 2023 15:42:47 +0700
Subject: Fix showing pricelist price on product detail

---
 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 a8cca416..b3174483 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -441,7 +441,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                 {sellingProductFormat(product?.qtySold) + ' Terjual'}
               </div>
             )}
-            {lowestPrice?.isFlashsale && lowestPrice?.price.discountPercentage > 0 ? (
+            {product?.flashSale?.id && 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 6ebe202147269100cd63ef125e877e8f693a27a1 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 17 Nov 2023 10:13:21 +0700
Subject: hotfix/round down discount precentage

---
 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 b3174483..5f034c09 100644
--- a/src/lib/product/components/Product/ProductDesktop.jsx
+++ b/src/lib/product/components/Product/ProductDesktop.jsx
@@ -445,7 +445,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
               <>
                 <div className='flex gap-x-1 items-center mt-2'>
                   <div className='badge-solid-red text-caption-1'>
-                    {lowestPrice?.price?.discountPercentage}%
+                    {Math.floor(lowestPrice?.price?.discountPercentage)}%
                   </div>
                   <div className='text-gray_r-9 line-through text-caption-1'>
                     {currencyFormat(lowestPrice?.price?.price)}
@@ -584,7 +584,7 @@ const ProductDesktop = ({ products, wishlist, toggleWishlist }) => {
                           <>
                             <div className='flex items-center gap-x-1 justify-center'>
                               <div className='badge-solid-red text-caption-1'>
-                                {variant?.price?.discountPercentage}%
+                                {Math.floor(variant?.price?.discountPercentage)}%
                               </div>
                               <div className='line-through text-caption-1 text-gray_r-11'>
                                 {currencyFormat(variant?.price?.price)}
-- 
cgit v1.2.3

