Home > doofinder > StatsClient > addToCart

StatsClient.addToCart() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Adds an amount of item to the cart in the current session.

Signature:

addToCart(params: CartItemStatsParams): Promise<Response>;

Parameters

Parameter Type Description
params CartItemStatsParams An options object. See CartItemStatsParams.

Returns:

Promise<Response>

A promise to be fullfilled with the response or rejected with a ClientResponseError.

Remarks

The cart will be automatically stored in stats if there’s any call to registerCheckout. If the item is already in the cart, the amount is automatically added to the current amount.