DocumentationCartFunctions

Clear Cart

amerta


amerta / Cart / clearCart

Function: clearCart()

clearCart(): Promise<{ cart: CartWithCalculations; error?: null; } | { cart?: null; error: ApiError; }>

Defined in: amerta/theme/utilities/cart.client.ts:205

Clears all items from the cart.

Returns

Promise<{ cart: CartWithCalculations; error?: null; } | { cart?: null; error: ApiError; }>

The updated cart or an error object.

Example

const res = await clearCart();