mirror of
https://github.com/vercel/commerce.git
synced 2025-06-29 09:51:22 +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
|
||||
}
|
||||
|
||||
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[]) =>
|
||||
items.reduce(countItem, count)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user