Skip to content

changeCartItemQuantity

changeCartItemQuantity

Definition

Changes the current quantity in specific cart line item to given quantity.

Example: If current quantity is 3 and you pass 2 as quantity parameter, you will get a new cart's state with quantity 2.

Signature

ts
export async function changeCartItemQuantity(
  itemId: string,
  newQuantity = 1,
  contextInstance: ShopwareApiInstance = defaultInstance,
): Promise<Cart>

Parameters

NameTypeDescription
itemId
string
id of the cart line item
newQuantity
new quantity of the cart line item
contextInstance
ShopwareApiInstance
instance of the api client (by default it's an Axios instance)

Return type

ts
Promise<Cart>

Usage example

WARNING

Example is generated automatically. Sometimes it's required to be adjusted to your needs.

Open in StackBlitz