diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-07 10:33:30 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-07 10:33:30 +0700 |
| commit | a05ed67c86c432a764e1cbd97dcc81cca2187bfe (patch) | |
| tree | 4a91073280a3b2e3f4462410170853063db47b2b /src/lib | |
| parent | d70e6df0323820d5772767625c76087c026e5376 (diff) | |
<Miqdad> fix cannot buy from google ads
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/product/components/Product/ProductDesktopVariant.jsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx index 0eef016a..f876d369 100644 --- a/src/lib/product/components/Product/ProductDesktopVariant.jsx +++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx @@ -103,7 +103,6 @@ const ProductDesktopVariant = ({ variantQuantityRefs.current[variantId] = element; }; - const handleAddToCart = (variant) => { if (!auth) { router.push(`/login?next=/shop/product/${slug}?srsltid=${srsltid}`); @@ -123,7 +122,7 @@ const ProductDesktopVariant = ({ }); setAddCartAlert(true); }; - + const toInt = (v) => { const n = parseInt(String(v ?? '').trim(), 10); return Number.isFinite(n) ? n : 0; @@ -136,10 +135,10 @@ const ProductDesktopVariant = ({ } return true; }; - + const handleBuy = async (variant) => { const quantity = Math.max(1, toInt(quantityInput)); // clamp min 1 - + let isLoggedIn = typeof auth === 'object'; if (!isLoggedIn) { const currentUrl = encodeURIComponent(router.asPath); |
