From 93832023b7c2f560bd90a02e9768d0fccec79078 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 3 May 2023 16:03:45 +0700
Subject: whatsapp url

---
 src/lib/variant/components/VariantCard.jsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/lib/variant/components/VariantCard.jsx')

diff --git a/src/lib/variant/components/VariantCard.jsx b/src/lib/variant/components/VariantCard.jsx
index 8cd70bc0..93234c53 100644
--- a/src/lib/variant/components/VariantCard.jsx
+++ b/src/lib/variant/components/VariantCard.jsx
@@ -6,6 +6,7 @@ import Link from '@/core/components/elements/Link/Link'
 import { createSlug } from '@/core/utils/slug'
 import currencyFormat from '@/core/utils/currencyFormat'
 import { updateItemCart } from '@/core/utils/cart'
+import whatsappUrl from '@/core/utils/whatsappUrl'
 
 const VariantCard = ({ product, openOnClick = true, buyMore = false }) => {
   const router = useRouter()
@@ -57,7 +58,13 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => {
           {product.price.priceDiscount > 0 ? (
             currencyFormat(product.quantity * product.price.priceDiscount)
           ) : (
-            <a href='https://wa.me/628128080622' className='underline text-danger-500'>
+            <a
+              href={whatsappUrl('product', {
+                name: product.name,
+                url: createSlug('/shop/product/', product.name, product.id, true)
+              })}
+              className='underline text-danger-500'
+            >
               Call For Price{' '}
             </a>
           )}
-- 
cgit v1.2.3

