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/ProductMobile.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx
index 20a1d3f4..63b391d5 100644
--- a/src/lib/product/components/Product/ProductMobile.jsx
+++ b/src/lib/product/components/Product/ProductMobile.jsx
@@ -174,7 +174,7 @@ const ProductMobile = ({ product, 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/ProductMobile.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx
index 63b391d5..ffa75f72 100644
--- a/src/lib/product/components/Product/ProductMobile.jsx
+++ b/src/lib/product/components/Product/ProductMobile.jsx
@@ -161,7 +161,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
   return (
     <MobileView>
       <div className='relative'>
-        {product?.flashSale?.remainingTime > 0 && (
+        {product?.flashSale?.remainingTime > 0 && activeVariant?.price.discountPercentage > 0 && (
           <div className={`absolute bottom-0 w-full`}>
             <div className='absolute bottom-0 w-full'>
               <ImageNext
@@ -232,7 +232,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
             <div className='text-gray_r-12/80 text-caption-2 mt-2 mb-1'>Harga mulai dari: </div>
           )}
 
-        {activeVariant.isFlashsale ? (
+        {activeVariant.isFlashsale && activeVariant?.price?.discountPercentage > 0 ? (
           <>
             <div className='flex gap-x-1 items-center'>
               <div className='badge-solid-red'>{activeVariant?.price?.discountPercentage}%</div>
-- 
cgit v1.2.3

