SessionCartContextState
Properties
This function adds an item to the session cart.
clearItems
() => voidRequiredRemoves all items in the cart.
decrementItemQuantity
(id: string) => voidRequiredThis function decrements the item's quantity in the cart.
This function retrieves an item's details by its ID.
incrementItemQuantity
(id: string) => voidRequiredThis function increments the item's quantity in the cart.
The items in the cart.
The region of the cart.
removeItem
(id: string) => voidRequiredThis function removes an item from the session cart.
A state function used to set the items in the cart.
A state function used to set the region.
total
numberRequiredThe total amount of the cart.
totalItems
numberRequiredThe total items in the cart.
This function updates an item in the session cart.
updateItemQuantity
(id: string, quantity: number) => voidRequiredThis function updates an item's quantity in the cart.
Was this section helpful?