summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-09-22 16:43:11 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-09-22 16:43:11 +0700
commit562f5c23badaeb8640236de38193dccf38d6d1ed (patch)
treea967cbf2a5a7b150fdd00d1e8caae85455176069
parent8e4e981060b612f5d21f141d62656df80e2a0a4b (diff)
update variant
-rw-r--r--src/core/components/elements/Navbar/NavbarDesktop.jsx20
-rw-r--r--src/lib/cart/components/Cartheader.jsx3
-rw-r--r--src/lib/product/components/Product/ProductDesktopVariant.jsx4
3 files changed, 7 insertions, 20 deletions
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index 3aba55c9..fb94e4a6 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -111,26 +111,6 @@ const NavbarDesktop = () => {
Quotation
</Link>
<Cardheader cartCount={cartCount}/>
- {/* <Link
- href='/shop/cart'
- target='_blank'
- rel='noreferrer'
- className='flex items-center gap-x-2 !text-gray_r-12/80'
- >
- <div className={`relative ${cartCount > 0 && 'mr-2'}`}>
- <ShoppingCartIcon className='w-7' />
- {cartCount > 0 && (
- <span className='absolute -top-2 -right-2 badge-solid-red rounded-full w-5 h-5 flex items-center justify-center'>
- {cartCount}
- </span>
- )}
- </div>
- <span>
- Keranjang
- <br />
- Belanja
- </span>
- </Link> */}
<Link
target='_blank'
rel='noreferrer'
diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx
index 863b8a46..085b9408 100644
--- a/src/lib/cart/components/Cartheader.jsx
+++ b/src/lib/cart/components/Cartheader.jsx
@@ -8,6 +8,7 @@ import { useRouter } from 'next/router'
import odooApi from '@/core/api/odooApi'
import { useProductCartContext } from '@/contexts/ProductCartContext'
import whatsappUrl from '@/core/utils/whatsappUrl'
+import SummaryProduct from '@/core/components/elements/Product/SummaryProduct'
const { ShoppingCartIcon, PhotoIcon } = require('@heroicons/react/24/outline')
const { default: Link } = require('next/link')
@@ -73,6 +74,7 @@ const Cardheader = (cartCount) => {
useEffect(() => {
if (refreshCart) {
refreshCartf()
+ console.log('ini masuk')
}
setRefreshCart(false)
}, [refreshCart, refreshCartf, setRefreshCart])
@@ -131,6 +133,7 @@ const Cardheader = (cartCount) => {
</Link>
</div>
<hr className='mt-3 mb-3 border border-gray-100' />
+ {/* <SummaryProduct products = {products} isLoading={isLoading} itemLoading = {itemLoading}/> */}
<div className='flow-root max-h-[250px] overflow-y-auto'>
{!auth && (
<div className='justify-center p-4'>
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)
}