getLoyaltyPointsExchangePrice(): FullPrice | null¶
The getLoyaltyPointsExchangePrice
method allows to retrieve the price of exchanged items.
Returned value¶
A returned value has a type of FullPrice | null
where FullPrice represents a price model.
Example¶
In this example we make a basketLoyaltyApi
call to retrieve 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.getLoyaltyPointsExchangePrice();
console.log('The price of items exchanged in a loyalty program: ', loyaltyPointsExchangePrice);
});
Basket Loyalty API methods reference¶
- selectLoyaltyPointsAwarded$
- getLoyaltyPointsAwarded
- selectHasItemsPaidInLoyaltyPoints$
- getHasItemsPaidInLoyaltyPoints
- selectLoyaltyPointsCost$
- getLoyaltyPointsCost
- selectLoyaltyPointsExchangePrice$