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