We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95a1b28 commit bf3850aCopy full SHA for bf3850a
components/Cart/Cart.component.jsx
@@ -10,10 +10,15 @@ import { AppContext } from 'utils/context/AppContext';
10
const Cart = ({ stickyNav }) => {
11
const [cart] = useContext(AppContext);
12
13
- const productsCount = cart.cart.contents.nodes.reduce(
+ /*const productsCount = cart.contents.nodes.reduce(
14
(total, product) => total + product.quantity,
15
0
16
- );
+ );*/
17
+
18
+ const productsCount =
19
+ null !== cart && Object.keys(cart).length ? cart.totalProductsCount : '';
20
21
22
23
return (
24
<>
0 commit comments