Skip to content

getSelectedShippingCountry(): ShippingCountry | undefined

The getSelectedShippingCountry method allows to retrieve the currently selected shipping country.

Returned value

A returned value has a type of ShippingCountry | undefined where ShippingCountry represents the ShippingCountry model.

Example

In this example we make a basketShippingsApi call to retrieve the currently selected shipping country.

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

        const selectedShippingCountry = basketShippingsApi.getSelectedShippingCountry();
    });
});

Basket Address API methods reference

Models reference