Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA-3117::[PWA] display number of items in cart instead of quantities… #4149

Merged
merged 8 commits into from
Sep 27, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const CartTriggerFragment = gql`
fragment CartTriggerFragment on Cart {
id
total_quantity
total_summary_quantity_including_config
}
`;
2 changes: 1 addition & 1 deletion packages/peregrine/lib/talons/Header/useCartTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const useCartTrigger = props => {
errorPolicy: 'all'
});

const itemCount = data?.cart?.total_quantity || 0;
const itemCount = data?.cart?.total_summary_quantity_including_config || 0;

const handleTriggerClick = useCallback(() => {
// Open the mini cart.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Array [
<div>
<button
aria-expanded={false}
aria-label="Toggle mini cart. You have 100 items in your cart."
aria-label="Toggle mini cart. You have 0 items in your cart."
onClick={[Function]}
>
<span>
Expand Down Expand Up @@ -34,14 +34,11 @@ Array [
/>
</svg>
</span>
<span>
99+
</span>
</button>
</div>,
<button
aria-expanded={false}
aria-label="Toggle mini cart. You have 100 items in your cart."
aria-label="Toggle mini cart. You have 0 items in your cart."
onClick={[Function]}
>
<span>
Expand Down Expand Up @@ -70,9 +67,6 @@ Array [
/>
</svg>
</span>
<span>
99+
</span>
</button>,
<require('../MiniCart')
isOpen={false}
Expand All @@ -86,7 +80,7 @@ Array [
<div>
<button
aria-expanded={false}
aria-label="Toggle mini cart. You have 10 items in your cart."
aria-label="Toggle mini cart. You have 0 items in your cart."
onClick={[Function]}
>
<span>
Expand Down Expand Up @@ -115,14 +109,11 @@ Array [
/>
</svg>
</span>
<span>
10
</span>
</button>
</div>,
<button
aria-expanded={false}
aria-label="Toggle mini cart. You have 10 items in your cart."
aria-label="Toggle mini cart. You have 0 items in your cart."
onClick={[Function]}
>
<span>
Expand Down Expand Up @@ -151,9 +142,6 @@ Array [
/>
</svg>
</span>
<span>
10
</span>
</button>,
<require('../MiniCart')
isOpen={false}
Expand Down