feat(MED-100): show cart line item quantities total instead of items total count

This commit is contained in:
2025-08-28 14:20:27 +03:00
parent b931035c3b
commit b3505c1627
3 changed files with 7 additions and 6 deletions

View File

@@ -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>