From 591dc095a0e5f655e419ec4d1ae11d8f54bed196 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Mon, 9 Oct 2023 10:51:46 +0700
Subject: update fitur variant page

---
 .../components/Product/ProductDesktopVariant.jsx       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 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 51739bc9..ef61bafd 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -140,7 +140,7 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
           <div className='w-full flex flex-wrap'>
             <div className='w-5/12'>
               <Image
-                src={product.parent.image}
+                src={product.image}
                 alt={product.name}
                 className='h-[430px] object-contain object-center w-full border border-gray_r-4'
               />
@@ -270,32 +270,32 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
             </div> */}
           </div>
           <div className='w-[25%]'>
-            {product?.flashSale?.remainingTime > 0 ? (
+            {product?.isFlashsale > 0 && product?.price?.discountPercentage > 0? (
               <>
                 <div className='flex gap-x-1 items-center mt-2'>
                   <div className='badge-solid-red text-caption-1'>
-                    {lowestPrice?.discountPercentage}%
+                    {product?.price?.discountPercentage}%
                   </div>
                   <div className='text-gray_r-9 line-through text-caption-1'>
-                    {currencyFormat(lowestPrice?.price)}
+                    {currencyFormat(product?.price?.price)}
                   </div>
                   <div className='text-danger-500 font-semibold text-xl'>
-                    {currencyFormat(lowestPrice?.priceDiscount)}
+                    {currencyFormat(product?.price?.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)}
+                  {currencyFormat(product?.price?.priceDiscount * process.env.NEXT_PUBLIC_PPN)}
                 </div>
               </>
             ) : (
               <h3 className='text-danger-500 font-semibold mt-1 text-title-md'>
-                {lowestPrice?.price > 0 ? (
+                {product?.price?.price > 0 ? (
                   <>
-                    {currencyFormat(lowestPrice?.price)}
+                    {currencyFormat(product?.price?.price)}
                     <div className='text-gray_r-9 text-base font-normal mt-1'>
                       Termasuk PPN:{' '}
-                      {currencyFormat(lowestPrice?.price * process.env.NEXT_PUBLIC_PPN)}
+                      {currencyFormat(product?.price?.price * process.env.NEXT_PUBLIC_PPN)}
                     </div>
                   </>
                 ) : (
-- 
cgit v1.2.3

