summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/AddToCart.tsx
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-11-13 10:38:49 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-11-13 10:38:49 +0000
commit4e24ad6def0e8df890b72f2f7f877424d8ed84cc (patch)
tree3f11401901f5439fb25ea351346ec14ee622fa26 /src-migrate/modules/product-detail/components/AddToCart.tsx
parent9cbbe5e12f97af023e2f53e4add4c5e5fd9b4667 (diff)
parent48c1110541a30bb33726a6f46737615b98f1d9c5 (diff)
Merged in fix_indexing_google (pull request #470)
<MIqdad>Fix indexing google
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToCart.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/AddToCart.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx
index 147fd6d2..0dc39c1c 100644
--- a/src-migrate/modules/product-detail/components/AddToCart.tsx
+++ b/src-migrate/modules/product-detail/components/AddToCart.tsx
@@ -66,6 +66,8 @@ const AddToCart = ({
weight: '',
isFlashSale: false,
});
+ const hasPrice =
+ !!product?.lowest_price && Number(product.lowest_price.price) > 0;
useEffect(() => {
const fetchData = async () => {
@@ -183,6 +185,7 @@ const AddToCart = ({
colorScheme={btnConfig[source].colorScheme}
variant={btnConfig[source].variant}
className='w-full'
+ isDisabled={!hasPrice || status === 'loading'}
>
{btnConfig[source].text}
</Button>
@@ -194,6 +197,7 @@ const AddToCart = ({
colorScheme={btnConfig[source].colorScheme}
variant={btnConfig[source].variant}
className='w-full'
+ isDisabled={!hasPrice || status === 'loading'}
>
{btnConfig[source].text}
</Button>
@@ -208,7 +212,10 @@ const AddToCart = ({
{/* ===== MOBILE LAYOUT: konten scroll + footer fixed di dalam popup ===== */}
<div className='md:hidden flex flex-col max-h-[75vh]'>
{/* area scroll */}
- <div className='flex-1 overflow-y-auto' style={{ scrollbarWidth: 'none' }}>
+ <div
+ className='flex-1 overflow-y-auto'
+ style={{ scrollbarWidth: 'none' }}
+ >
{/* HEADER ITEM */}
<div className='flex mt-4'>
<div className='w-[25%]'>