From bda91439b6ef4605a579bde8bef603b551aab3dd Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 22 Sep 2023 09:08:13 +0700 Subject: cart call for price --- src/lib/cart/components/Cartheader.jsx | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/lib/cart/components/Cartheader.jsx') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index 3fc959d4..dd6c276e 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -7,6 +7,7 @@ import useAuth from '@/core/hooks/useAuth' import { useRouter } from 'next/router' import odooApi from '@/core/api/odooApi' import { useProductCartContext } from '@/contexts/ProductCartContext' +import whatsappUrl from '@/core/utils/whatsappUrl' const { ShoppingCartIcon, PhotoIcon } = require('@heroicons/react/24/outline') const { default: Link } = require('next/link') @@ -27,7 +28,6 @@ const Cardheader = (cartCount) => { return productCart?.products || [] }, [productCart]) - const handleMouseEnter = () => { setIsHovered(true) getCart() @@ -79,7 +79,7 @@ const Cardheader = (cartCount) => { useEffect(() => { setCountCart(cartCount.cartCount) - }, []) + }, [cartCount]) const handleCheckout = async () => { SetButtonTerapkan(true) @@ -216,7 +216,29 @@ const Cardheader = (cartCount) => { )}
- {currencyFormat(product?.price?.priceDiscount)} + {product?.price?.priceDiscount > 0 ? ( + currencyFormat(product?.price?.priceDiscount) + ) : ( + + + Call For Price + + + )}
-- cgit v1.2.3