Chord OMS
...
Gatsby
SDK Reference
useCart
13min
The useCart hook returns a series of methods for interacting with the Shopify shopping cart.
Represents the current shopping cart.
Example:
Applies a promo code to the current order.
Example:
Adds an item to the current order.
Example:
Applies a gift card to the current order.
Example:
Redirects the browser to Shopify checkout.
Example:
Reloads the current shopping cart. This is automatically called on every page load and with every other useCart method.
Example:
Updates the quantity of a line item in the current order.
Example:
Updates a line item in the current order.
Example:
Removes a line item from the current order.
Example:
Removes a gift card from the current order.
Example:
Removes a promo code from the current order.
Example: