removeFromCart
Remove a product from the cart.
It uses the updateCart method to remove a product from the cart.
Signature
declare function removeFromCart(
context: CommercetoolsIntegrationContext,
cart: RemoveFromCartParams,
product: LineItem,
customQuery?: CustomQuery
): Promise<RemoveFromCartResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | CommercetoolsIntegrationContext | |
cart | Required | RemoveFromCartParams | |
product | Required | LineItem | |
customQuery | Optional | CustomQuery |
Referenced Types
Examples
Removing a product from the cart.
const { cart } = await sdk.commerce.removeFromCart(
{ id: 'cart-id', version: '1' },
{ id: 'line-item-id', quantity: 1 } as LineItem
);