From 562f5c23badaeb8640236de38193dccf38d6d1ed Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 22 Sep 2023 16:43:11 +0700
Subject: update variant

---
 src/lib/product/components/Product/ProductDesktopVariant.jsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/lib/product/components/Product/ProductDesktopVariant.jsx')

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 940ba46f..df294df5 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -17,6 +17,7 @@ import whatsappUrl from '@/core/utils/whatsappUrl'
 import useAuth from '@/core/hooks/useAuth'
 import odooApi from '@/core/api/odooApi'
 import { Button, Spinner } from 'flowbite-react'
+import { useProductCartContext } from '@/contexts/ProductCartContext'
 
 const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant }) => {
   const router = useRouter()
@@ -28,6 +29,8 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
   const [addCartAlert, setAddCartAlert] = useState(false)
   const [isLoadingSLA, setIsLoadingSLA] = useState(true)
 
+  const {setRefreshCart} = useProductCartContext()
+
   const getLowestPrice = useCallback(() => {
     const lowest = product.price
     /* const lowest = prices.reduce((lowest, price) => {
@@ -72,6 +75,7 @@ const ProductDesktopVariant = ({ product, wishlist, toggleWishlist, isVariant })
       selected: true,
       source: null
     })
+    setRefreshCart(true)
     setAddCartAlert(true)
   }
 
-- 
cgit v1.2.3

