website logo
Navigate through spaces
Chord Commerce
⌘K
Getting Started
CMS
Data
OMS
Integrations
👩‍💻Developer Tools
Shopify
Docs powered by archbee 

useCart

The useCart hook returns a series of methods for interacting with the Shopify shopping cart.

JS
|

cart

Represents the current shopping cart.

Example:

JS
|

addPromoCode()

Applies a promo code to the current order.

Example:

JS
|

addToCart()

Adds an item to the current order.

Example:

JS
|

applyGiftCard()

Applies a gift card to the current order.

Example:

JS
|

checkout()

Redirects the browser to Shopify checkout.

Example:

JS
|

loadCart()

Reloads the current shopping cart. This is automatically called on every page load and with every other useCart method.

Example:

JS
|

modifyQuantity()

Updates the quantity of a line item in the current order.

Example:

JS
|

modifyLineItem()

Updates a line item in the current order.

Example:

JS
|

removeFromCart()

Removes a line item from the current order.

Example:

JS
|

removeGiftCard()

Removes a gift card from the current order.

Example:

JS
|

removePromoCode()

Removes a promo code from the current order.

Example:

JS
|



Updated 09 Nov 2022
Did this page help you?
Yes
No
UP NEXT
useUser
Docs powered by archbee 
TABLE OF CONTENTS
cart
addPromoCode()
addToCart()
applyGiftCard()
checkout()
loadCart()
modifyQuantity()
modifyLineItem()
removeFromCart()
removeGiftCard()
removePromoCode()