CartContext
The cart context available if the CartProvider is used previously in the React components tree.
Properties
addShippingMethodUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartShippingMethodReq, unknown>RequiredA mutation used to add a shipping method to the cart during checkout.
Using it is equivalent to using the useAddShippingMethodToCart mutation.
addShippingMethodUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartShippingMethodReq, unknown>RequiredcompleteCheckoutUseMutationResult<Response<StoreCompleteCartRes>, Error, void, unknown>RequiredA mutation used to complete the cart and place the order.
Using it is equivalent to using the useCompleteCart mutation.
createCartUseMutationResult<Response<StoreCartsRes>, Error, undefined | StorePostCartReq, unknown>RequiredA mutation used to create a cart.
Using it is equivalent to using the useCreateCart mutation.
payUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartPaymentSessionReq, unknown>RequiredA mutation used to select a payment processor during checkout.
Using it is equivalent to using the useSetPaymentSession mutation.
payUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartPaymentSessionReq, unknown>RequiredsetCart(cart: Omit<Cart, "refundable_amount" | "refunded_total">) => voidRequiredA state function used to set the cart object.
startCheckoutUseMutationResult<Response<StoreCartsRes>, Error, void, unknown>RequiredA mutation used to initialize payment sessions during checkout.
Using it is equivalent to using the useCreatePaymentSession mutation.
totalItemsnumberRequiredThe number of items in the cart.
updateCartUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartReq, unknown>RequiredA mutation used to update a cart’s details such as region, customer email, shipping address, and more.
Using it is equivalent to using the useUpdateCart mutation.
updateCartUseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartReq, unknown>RequiredcartOmit<Cart, "refundable_amount" | "refunded_total">The currently-used cart.
cartOmit<Cart, "refundable_amount" | "refunded_total">Was this section helpful?