From 4e3d9f20b7106f12c576eeb402da2b29c660a414 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 3 Oct 2023 15:37:59 +0700
Subject: bugfix widget wa di page variant detail

---
 src/core/components/layouts/BasicLayout.jsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src/core/components/layouts/BasicLayout.jsx')

diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx
index e6bd4de0..9441dbd7 100644
--- a/src/core/components/layouts/BasicLayout.jsx
+++ b/src/core/components/layouts/BasicLayout.jsx
@@ -24,13 +24,12 @@ const BasicLayout = ({ children }) => {
   const router = useRouter()
 
   const { product } = useProductContext()
-
   useEffect(() => {
-    if (router.pathname === '/shop/product/[slug]') {
+    if (router.pathname === '/shop/product/[slug]' || router.pathname === '/shop/product/variant/[slug]') {
       setPayloadWa({
         name: product?.name,
         manufacture: product?.manufacture.name,
-        url: createSlug('/shop/product/', product?.name, product?.id, true)
+        url: process.env.NEXT_PUBLIC_SELF_HOST + router.asPath
       })
       setTemplateWA('product')
 
-- 
cgit v1.2.3

