summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/AddToCart.tsx
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-13 09:56:07 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-13 09:56:07 +0700
commit55c8f1c3c6c3566afe6555b7e3714f2738d0bb8e (patch)
tree58f335069c84c2b719af698017b229955255bf9f /src-migrate/modules/product-detail/components/AddToCart.tsx
parent03b678070e53f4f83c947d073e5a9ec01d469992 (diff)
<Miqdad> fix selected variantHEADnew-release
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToCart.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/AddToCart.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx
index 18f90012..a8523f55 100644
--- a/src-migrate/modules/product-detail/components/AddToCart.tsx
+++ b/src-migrate/modules/product-detail/components/AddToCart.tsx
@@ -51,7 +51,7 @@ const AddToCart = ({
const { isMobile, isDesktop } = useDevice();
- const { askAdminUrl } = useProductDetail();
+ const { askAdminUrl, selectedVariant } = useProductDetail();
const [product, setProducts] = useState(products);
const [status, setStatus] = useState<Status>('idle');
@@ -72,8 +72,7 @@ const AddToCart = ({
weight: '',
isFlashSale: false,
});
- const hasPrice =
- !!product?.lowest_price && Number(product.lowest_price.price) > 0;
+ const hasPrice = Number(selectedVariant?.price?.price_discount || 0) > 0;
useEffect(() => {
const fetchData = async () => {