selectAvailableShippingCountries$(): Observable<Country[]>¶
The selectAvailableShippingCountries$
method allows to observe the available shipping countries.
Returned value¶
A returned value has a type of Country[]
where Country
represents the Country model.
Example¶
In this example we make a basketShippingsApi
call to observe the available shipping countries.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketShippingsApi = await getApi('basketShippingsApi');
const availableShippingCountries$ = basketShippingsApi.selectAvailableShippingCountries$();
availableShippingCountries$.subscribe((availableShippingCountries) => {
console.log('currently available shipping countries:', availableShippingCountries);
});
});
});
Basket Address API methods reference¶
- get
- select
- setShipping
- setPickupPoint
- getSelectedShipping
- selectSelectedShipping
- getAvailableShippingCountries
- getSelectedShippingCountry
- selectSelectedShippingCountry
- setCountry
- getPaymentCostForActiveShippingByPaymentId
- selectPaymentCostForActiveShippingByPaymentId
- isEveryAvailablePaymentFree
- selectIsEveryAvailablePaymentFree
- getSectionValidation
- selectSectionValidation
- addMap
- showPickupPointMap
- shouldDisplayRemainingBasketValueForFreeShippingMessage
- addShippingInfo
- getShippingInfo