Skip to content

cleanBasket(): Promise<void>

The cleanBasket is an asynchronous method that allows to clear the products in the current basket.

Returned value

A returned value has a type of Promise<void> as this method returns nothing.

Example

In this example we make a basketOverallApi call to clear the products in the basket.

useStorefront(async (storefront) => {
    const basketOverallApi = storefront.getApiSync('basketOverallApi');

    await basketOverallApi.cleanBasket();
});

Basket Overall API methods reference