Alokai
You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x

removeCartEntry

Remove a product from the cart in SAP Commerce Cloud.

This method exchanges data with the removeCartEntry endpoint exposed by the SAP OCC API Cart Entries Controller.

When vsf-sap-token cookie is present in the request, this method will remove a product from the current user's cart. In case there is no cookie, it will remove it from the anonymous user's cart. For logged-in users, make sure to pass cart code as the cartId param. In case of anonymous users, pass cart guid instead.

Signature

export declare function removeCartEntry(
	context: SapccIntegrationContext,
	props: DeleteFromCartProps
): Promise<void>;

Parameters

NameRequiredTypeDescription
contextRequiredSapccIntegrationContext
propsRequiredDeleteFromCartPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.

Returns

This method does not return anything.

Referenced Types

Examples

Removing product from the cart.

import { sdk } from '~/sdk';

await sdk.commerce.removeCartEntry({
  cartId: '00035084',
  entryNumber: 1
});

On this page