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¶
- getActions
- selectActions$
- getId
- selectId$
- getComment
- selectComment$
- getIsVatEu
- selectIsVatEu$
- getDelivery
- selectDelivery$
- getSum
- selectSum$
- getSumWithoutPaymentAndShipping
- selectSumWithoutPaymentAndShipping$
- setComment
- getInvalidSections
- selectInvalidSections$
- getSectionValidation
- selectSectionValidation$