Skip to content

selectSum$(): Observable<Price[]>

The selectSum$ method allows to select a list of tax prices associated with a current basket.

Returned value

A returned value has a type of Observable<Price[]> representing a list of tax prices.

Example

In this example we make a basketTaxesApi call to select the list of tax prices for a current basket.

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

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

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

    const taxPrices$ = basketTaxesApi.selectSum$();
});

Basket Taxes API methods reference

Models reference