Skip to content

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 ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketProductsApi = await getApi('basketProductsApi');

        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

Models reference