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;
|
: 0;
|
||||||
|
|
||||||
const cartItemsCount = props.cart?.items?.length ?? 0;
|
const cartQuantityTotal = props.cart?.items?.reduce((acc, item) => acc + item.quantity, 0) ?? 0;
|
||||||
const hasCartItems = cartItemsCount > 0;
|
const hasCartItems = cartQuantityTotal > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'flex w-full flex-1 items-center justify-between gap-3'}>
|
<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]" />
|
<ShoppingCart className="stroke-[1.5px]" />
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common:shoppingCartCount"
|
i18nKey="common:shoppingCartCount"
|
||||||
values={{ count: cartItemsCount }}
|
values={{ count: cartQuantityTotal }}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ export function HomeMobileNavigation(props: {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const cartItemsCount = props.cart?.items?.length ?? 0;
|
const cartQuantityTotal = props.cart?.items?.reduce((acc, item) => acc + item.quantity, 0) ?? 0;
|
||||||
const hasCartItems = cartItemsCount > 0;
|
const hasCartItems = cartQuantityTotal > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
@@ -83,7 +83,7 @@ export function HomeMobileNavigation(props: {
|
|||||||
path="/home/cart"
|
path="/home/cart"
|
||||||
label="common:shoppingCartCount"
|
label="common:shoppingCartCount"
|
||||||
Icon={<ShoppingCart className="stroke-[1.5px]" />}
|
Icon={<ShoppingCart className="stroke-[1.5px]" />}
|
||||||
labelOptions={{ count: cartItemsCount }}
|
labelOptions={{ count: cartQuantityTotal }}
|
||||||
/>
|
/>
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ RETURNS boolean AS $$
|
|||||||
SELECT EXISTS (
|
SELECT EXISTS (
|
||||||
SELECT 1 FROM medreport.medipost_actions
|
SELECT 1 FROM medreport.medipost_actions
|
||||||
WHERE medusa_order_id = $1
|
WHERE medusa_order_id = $1
|
||||||
|
AND action = 'send_order_to_medipost'
|
||||||
AND has_error = true
|
AND has_error = true
|
||||||
);
|
);
|
||||||
$$ LANGUAGE sql STABLE;
|
$$ LANGUAGE sql STABLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user