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… #4150

Closed
wants to merge 6 commits into from
Closed
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
}
`;
1 change: 1 addition & 0 deletions packages/peregrine/lib/talons/Header/useCartTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const useCartTrigger = props => {
errorPolicy: 'all'
});


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

const handleTriggerClick = useCallback(() => {
Expand Down
16 changes: 16 additions & 0 deletions packages/venia-concept/lastCachedGraphQLSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,22 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "total_summary_quantity_including_config",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Float",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
Expand Down