updateCartQuantity
Update the quantity of a product in the cart.
It uses the updateCart method to update the quantity of a product in the cart.
Signature
declare function updateCartQuantity(
context: CommercetoolsIntegrationContext,
cart: UpdateCartQuantityParams,
product: UpdateCartQuantityProductParams,
customQuery?: CustomQuery
): Promise<UpdateCartQuantityResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | CommercetoolsIntegrationContext | |
cart | Required | UpdateCartQuantityParams | |
product | Required | UpdateCartQuantityProductParams | |
customQuery | Optional | CustomQuery |
Referenced Types
- CommercetoolsIntegrationContext
- UpdateCartQuantityParams
- UpdateCartQuantityProductParams
- CustomQuery
- UpdateCartQuantityResponse
Examples
Updating quantity of a product in the cart.
const { cart } = await sdk.commerce.updateCartQuantity(
{ id: '6931b5d2-986f-4d2b-8cba-45007a26eb5e', version: '1' },
{ id: 'ad7b9df8-8116-4c0e-a6fb-3ce37c98a6b3', quantity: 3 }
);