mirror of
https://github.com/vercel/commerce.git
synced 2025-06-29 18:01:21 +00:00
Cart Count will be Number of items rather than sum total quantity
This commit is contained in:
parent
629df7a9ab
commit
7fd402adde
@ -14,7 +14,7 @@ interface Props {
|
|||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const countItem = (count: number, item: any) => count + item.quantity
|
const countItem = (count: number, item: any) => count + (item.quantity > 0 ? 1 : 0)
|
||||||
const countItems = (count: number, items: any[]) =>
|
const countItems = (count: number, items: any[]) =>
|
||||||
items.reduce(countItem, count)
|
items.reduce(countItem, count)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user