Skip to content

remove(): Promise<void>

The remove method allows to remove a coupon code from the basket.

Returned value

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

Example

In this example we make a basketPromotionsApi call to remove a coupon code from the basket.

useStorefront(async (storefront) => {
    let basketPromotionsApi = storefront.getApiSync('basketPromotionsApi');

    if (!basketPromotionsApi) {
        const featureSystemApi = this.getApiSync('FeatureSystemApi');
        await featureSystemApi.registerDynamic('basket');

        basketPromotionsApi = storefront.getApiSync('basketPromotionsApi');
    }

    basketPromotionsApi.remove();
});

Basket Promotions API methods reference