feat(MED-100): show cart line item quantities total instead of items total count
This commit is contained in:
@@ -31,8 +31,8 @@ export async function HomeMenuNavigation(props: {
|
||||
})
|
||||
: 0;
|
||||
|
||||
const cartItemsCount = props.cart?.items?.length ?? 0;
|
||||
const hasCartItems = cartItemsCount > 0;
|
||||
const cartQuantityTotal = props.cart?.items?.reduce((acc, item) => acc + item.quantity, 0) ?? 0;
|
||||
const hasCartItems = cartQuantityTotal > 0;
|
||||
|
||||
return (
|
||||
<div className={'flex w-full flex-1 items-center justify-between gap-3'}>
|
||||
@@ -64,7 +64,7 @@ export async function HomeMenuNavigation(props: {
|
||||
<ShoppingCart className="stroke-[1.5px]" />
|
||||
<Trans
|
||||
i18nKey="common:shoppingCartCount"
|
||||
values={{ count: cartItemsCount }}
|
||||
values={{ count: cartQuantityTotal }}
|
||||
/>
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user