Skip to content

selectLoyaltyPointsExchangePrice$(): Observable<FullPrice | null>

The selectLoyaltyPointsExchangePrice$ method allows to select the price of exchanged items.

Returned value

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

Example

In this example we make a basketLoyaltyApi call to select the price of exchanged items.

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

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

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

    const loyaltyPointsExchangePrice$ = basketLoyaltyApi.selectLoyaltyPointsExchangePrice$();

    loyaltyPointsExchangePrice$.subscribe((loyaltyPointsExchangePrice) => {
        console.log('The price of items exchanged in a loyalty program: ', loyaltyPointsExchangePrice);
    });
});

Basket Loyalty API methods reference

Models reference