summaryrefslogtreecommitdiff
path: root/src/lib/variant
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-05-03 16:03:45 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-05-03 16:03:45 +0700
commit93832023b7c2f560bd90a02e9768d0fccec79078 (patch)
treea2c8780dcd8072205fedac9d7b22e8a2496e3e66 /src/lib/variant
parentbaa7cb664e662cee23cdad92c78d9c14cab2445d (diff)
whatsapp url
Diffstat (limited to 'src/lib/variant')
-rw-r--r--src/lib/variant/components/VariantCard.jsx9
1 files changed, 8 insertions, 1 deletions
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>
)}