showPickupPointMap(shipping: BasketShipping): Promise<void>¶
The showPickupPointMap
method allows to display the pickup point map for the given option.
Input parameters¶
shipping¶
shipping
is a mandatory parameter of the BasketShipping type that represents the shipping we want to check.
Returned value¶
A returned value has a type of Promise<void>
as this method returns nothing.
Example¶
In this example we make a basketShippingsApi
call to display the pickup point map for the current shipping.
useStorefront(async (storefront) => {
let basketShippingsApi = storefront.getApiSync('basketShippingsApi');
if (!basketShippingsApi) {
const featureSystemApi = this.getApiSync(FEATURE_SYSTEM_API_NAME);
await featureSystemApi.registerDynamic('basket');
basketShippingsApi = storefront.getApiSync('basketShippingsApi');
}
const selectedShipping$ = basketShippingsApi.selectSelectedShipping$();
selectedShipping$.subscribe(async (shippingOption) => {
if (!shippingOption) {
console.log('No shipping option is currently selected.');
return;
}
if (shippingOption.isPickupPointDelivery) {
await basketShippingsApi.showPickupPointMap(shippingOption);
}
});
});
Basket Address API methods reference¶
- get
- select
- setShipping
- setPickupPoint
- getSelectedShipping
- selectSelectedShipping
- getAvailableShippingCountries
- selectAvailableShippingCountries
- getSelectedShippingCountry
- selectSelectedShippingCountry
- setCountry
- getPaymentCostForActiveShippingByPaymentId
- selectPaymentCostForActiveShippingByPaymentId
- isEveryAvailablePaymentFree
- selectIsEveryAvailablePaymentFree
- getSectionValidation
- selectSectionValidation
- addMap
- shouldDisplayRemainingBasketValueForFreeShippingMessage
- addShippingInfo
- getShippingInfo