From cd51b64b48b0c898c6ff901c1bfa23c70cd9cf1a Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Wed, 12 Nov 2025 16:12:21 +0700
Subject: <MIqdad> sementara

---
 src-migrate/modules/product-detail/components/PriceAction.tsx | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src-migrate/modules/product-detail/components/PriceAction.tsx')

diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index ffc9ba40..a329d2cc 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -37,6 +37,7 @@ const PriceAction = ({ product }: Props) => {
   } = useProductDetail();
   const [qtyPickUp, setQtyPickUp] = useState(0);
   const { isDesktop, isMobile } = useDevice();
+
   useEffect(() => {
     setActive(selectedVariant);
     if (product.variants.length > 2 && product.variants[0].price.price === 0) {
-- 
cgit v1.2.3


From 7cf105a01a814c5f76dd6b407df284a44026cabf Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Wed, 12 Nov 2025 17:14:37 +0700
Subject: <Miqdad> done product detail

---
 .../product-detail/components/PriceAction.tsx      | 26 ++++++++++++++--------
 1 file changed, 17 insertions(+), 9 deletions(-)

(limited to 'src-migrate/modules/product-detail/components/PriceAction.tsx')

diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index a329d2cc..510dd6a9 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -78,6 +78,7 @@ const PriceAction = ({ product }: Props) => {
     const validJsonString = stringVoucher.replace(/'/g, '"');
     voucherPastiHemat = JSON.parse(validJsonString);
   }
+  const hasPrice = Number(product?.lowest_price?.price) > 0;
 
   return (
     <div
@@ -145,7 +146,7 @@ const PriceAction = ({ product }: Props) => {
         </>
       )}
 
-      {!!activePrice && activePrice.price === 0 && (
+      {/* {!!activePrice && activePrice.price === 0 && (
         <span>
           Hubungi kami untuk dapatkan harga terbaik,{' '}
           <Link
@@ -156,7 +157,7 @@ const PriceAction = ({ product }: Props) => {
             klik disini
           </Link>
         </span>
-      )}
+      )} */}
 
       <DesktopView>
         <div className='h-4' />
@@ -165,27 +166,32 @@ const PriceAction = ({ product }: Props) => {
           <div className='relative flex items-center'>
             <button
               type='button'
-              className='absolute left-0 px-2 py-1 h-full text-gray-500'
+              className='absolute left-0 px-2 py-1 h-full text-gray-500 disabled:opacity-40'
               onClick={() =>
                 setQuantityInput(String(Math.max(1, Number(quantityInput) - 1)))
               }
+              disabled={!hasPrice}
             >
               -
             </button>
+
             <input
               type='number'
               id='quantity'
               min={1}
               value={quantityInput}
               onChange={(e) => setQuantityInput(e.target.value)}
-              className={style['quantity-input']}
+              className={`${style['quantity-input']} disabled:bg-gray-100 disabled:text-gray-400`}
+              disabled={!hasPrice}
             />
+
             <button
               type='button'
-              className='absolute right-0 px-2 py-1 h-full text-gray-500'
+              className='absolute right-0 px-2 py-1 h-full text-gray-500 disabled:opacity-40'
               onClick={() =>
                 setQuantityInput(String(Number(quantityInput) + 1))
               }
+              disabled={!hasPrice}
             >
               +
             </button>
@@ -196,9 +202,11 @@ const PriceAction = ({ product }: Props) => {
             <Skeleton
               isLoaded={sla}
               h='21px'
-              className={sla?.qty < 10 ? 'text-red-600 font-medium' : ''}
+              className={
+                !hasPrice || sla?.qty < 10 ? 'text-red-600 font-medium' : ''
+              }
             >
-              Stock : {sla?.qty}{' '}
+              Stock : {hasPrice ? sla?.qty : 'Habis'}
             </Skeleton>
           </div>
 
@@ -219,9 +227,9 @@ const PriceAction = ({ product }: Props) => {
             )}
           </div>
         </div>
-        <span className='text-[12px] text-red-500 italic'>
+        {/* <span className='text-[12px] text-red-500 italic'>
           * {qtyPickUp} barang bisa di pickup
-        </span>
+        </span> */}
       </DesktopView>
 
       {/* ===== MOBILE: grid kiri-kanan, kanan hanya qty ===== */}
-- 
cgit v1.2.3


From 0eedef242e76673e6882ec11b87a9371d6ec5164 Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Wed, 12 Nov 2025 17:22:46 +0700
Subject: <Miqdad> mobile

---
 src-migrate/modules/product-detail/components/PriceAction.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/product-detail/components/PriceAction.tsx')

diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index 510dd6a9..d73ab5f6 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -264,11 +264,11 @@ const PriceAction = ({ product }: Props) => {
               )}
             </div>
 
-            {qtyPickUp > 0 && (
+            {/* {qtyPickUp > 0 && (
               <div className='text-[12px] mt-1 text-red-500 italic'>
                 * {qtyPickUp} barang bisa di pickup
               </div>
-            )}
+            )} */}
           </div>
 
           {/* Kanan: hanya qty, rata kanan */}
@@ -283,6 +283,7 @@ const PriceAction = ({ product }: Props) => {
                   )
                 }
                 aria-label='Kurangi'
+                disabled={!hasPrice}
               >
                 <span className='text-2xl leading-none'>–</span>
               </button>
@@ -297,6 +298,7 @@ const PriceAction = ({ product }: Props) => {
                [appearance:textfield] 
                [&::-webkit-outer-spin-button]:appearance-none 
                [&::-webkit-inner-spin-button]:appearance-none'
+                disabled={!hasPrice}
               />
 
               <button
@@ -306,6 +308,7 @@ const PriceAction = ({ product }: Props) => {
                   setQuantityInput(String(Number(quantityInput) + 1))
                 }
                 aria-label='Tambah'
+                disabled={!hasPrice}
               >
                 <span className='text-2xl leading-none'>+</span>
               </button>
-- 
cgit v1.2.3

