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

replaceCartDeliveryMode

Method setting a delivery mode for the cart in SAP Commerce Cloud.

This method sends a POST request to the replaceCartDeliveryMode endpoint of the Alokai Middleware. In turn, it exchanges data with the replaceCartDeliveryMode endpoint exposed by the SAP OCC API Cart Delivery Modes Controller.

This method will only work for either a current user cart or a guest cart (i.e. cart with an email added to it). It will not work with an anonymous cart. The cart has to be assigned a delivery address beforehand. In case of a guest cart, remember to pass cart guid as the cartId param. In case of a current user cart, pass cart code instead.

Signature

export declare function replaceCartDeliveryMode<Props extends ReplaceCartDeliveryModeProps = ReplaceCartDeliveryModeProps>(
	props: Props,
	options?: MethodOptions
): Promise<void>;

Parameters

NameRequiredTypeDescription
propsRequiredPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions that can be passed to additionally configure the request or customize the logic in a plugin.

Returns

This method does not return anything.

Referenced Types

Examples

Setting delivery mode for a cart.

import { sdk } from '~/sdk';

await sdk.commerce.replaceCartDeliveryMode({ cartId: '00035084', deliveryModeId: 'premium-gross' });

On this page