summaryrefslogtreecommitdiff
path: root/src/lib/cart/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cart/components')
-rw-r--r--src/lib/cart/components/Cart.jsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx
index 907d1267..8c4e7d42 100644
--- a/src/lib/cart/components/Cart.jsx
+++ b/src/lib/cart/components/Cart.jsx
@@ -17,6 +17,7 @@ import DesktopView from '@/core/components/views/DesktopView'
import ProductCard from '@/lib/product/components/ProductCard'
import productSearchApi from '@/lib/product/api/productSearchApi'
import whatsappUrl from '@/core/utils/whatsappUrl'
+import { gtagBeginCheckout } from '@/core/utils/googleTag'
const Cart = () => {
const router = useRouter()
@@ -134,6 +135,11 @@ const Cart = () => {
toast.success('Berhasil menghapus barang dari keranjang')
}
+ const handleCheckout = () => {
+ gtagBeginCheckout(products)
+ router.push('/shop/checkout')
+ }
+
return (
<>
<BottomPopup
@@ -465,7 +471,7 @@ const Cart = () => {
type='button'
className='btn-solid-red flex-1'
disabled={selectedProduct().length == 0}
- onClick={() => router.push('/shop/checkout')}
+ onClick={handleCheckout}
>
Checkout
</button>