Skip to content

selectSumWithoutPaymentAndShipping$(): Observable<FullPrice>

The selectSumWithoutPaymentAndShipping$ method allows to select information about a total sum of products in the current basket excluding payment method and shipping costs.

Returned value

A returned value has a type of Observable<FullPrice> where FullPrice represents a FullPrice model.

Example

In this example we make a basketOverallApi call to select a total sum of products in the basket without costs regarding the payment method and shipping.

useStorefront(async ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketOverallApi = await getApi('basketOverallApi');

        const sumWithoutPaymentAndShipping$ = basketOverallApi.selectSumWithoutPaymentAndShipping$();

        sumWithoutPaymentAndShipping$.subscribe((sumWithoutPaymentAndShipping) => {
            console.log('current sum without payment and shipping:', sumWithoutPaymentAndShipping.grossValueFormatted);
        });
    });
});

Basket Overall API methods reference

Models reference