Home > @shopware-pwa/shopware-6-client > changeCartItemQuantity

# changeCartItemQuantity() function

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:

export declare function changeCartItemQuantity(itemId: string, newQuantity?: number, contextInstance?: ShopwareApiInstance): Promise<Cart>;

# Parameters

Parameter Type Description
itemId string
newQuantity number
contextInstance ShopwareApiInstance

Returns:

Promise<Cart>

# Exceptions

ClientApiError