Function: useCart()
useCart(
options):UseCartReturn
Defined in: composables/react/useCart.ts:128
useCart — cart resolution and line-item management.
Parameters
options
see UseCartOptions.
Returns
cart state plus async actions — see UseCartReturn.
Remarks
GraphQL integration: all backend calls go through services.cart (CartService)
and services.crossupsell (CrossupsellService), derived from
options.graphqlClient via createServices. resolveCart() runs the shared
initCart flow (getCarts → startCart → updateCartAddress). addItem calls
addItemToCart; updateItemQuantity / updateItemNotes call updateCartItem
(the notes update is debounced); deleteItem calls deleteCartItem;
addActionCode / removeActionCode call addActionCodeToCart /
removeActionCodeFromCart; requestAuthorization calls
requestPurchaseAuthorization; processCart calls processCart to convert the
cart to an order; getCrossupsells calls crossupsell.getCrossupsells. Cart
mutations require a cart id; addItem can create one on demand via createCart.