diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 10:10:25 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 10:10:25 +0700 |
| commit | a235f77530f0f51b3637b4b1096552fe3058ed69 (patch) | |
| tree | c3634c3aa5f6e858189a996178bc383add650aa4 /src/lib/product/components | |
| parent | 857ba27d9df9361fb0e8f4b77004e8c9a2b86110 (diff) | |
Add gtag begin_checkout and purchase event
Diffstat (limited to 'src/lib/product/components')
| -rw-r--r-- | src/lib/product/components/Product/ProductDesktop.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 4a584761..6a87d022 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -65,10 +65,10 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { setAddCartAlert(true) } - const handleBuy = (variantId) => { - const quantity = variantQuantityRefs.current[variantId].value + const handleBuy = (variant) => { + const quantity = variantQuantityRefs.current[variant.id].value if (!validQuantity(quantity)) return - router.push(`/shop/checkout?productId=${variantId}&quantity=${quantity}`) + router.push(`/shop/checkout?productId=${variant.id}&quantity=${quantity}`) } const variantSectionRef = useRef(null) |
