Cart details is an object with skus of the items in the cart as keys and details of the items as the value, for example:
As you add more items to the cartItem array, cart details will update with quantity and total amount of that particular item.
Total number of items in the cart
Total price of all products in cart
These three API items provide basic state management for your cart. The cart state is stored in the
shouldDisplayCart variable. The two functions can be used to update this state.
shouldDisplayCart: Boolean value which can be used to handle the cart's displayed or undisplayed state.
handleCartClick: Function which toggles the displayed state for the cart between true and false, updates
Edit this page on GitHub
handleCloseCart: Function which sets the displayed cart state to false, updates