select$(): Observable<BasketShipping[]>¶
The select$
method allows you to observe all basket shipping options.
Returned value¶
A returned value has a type of Observable<BasketShipping[]>
where BasketShipping
represents the BasketShipping model.
Example¶
In this example, we make a basketShippingsApi
call to observe all basket shipping options.
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 basketShippingOptions$ = basketShippingsApi.select$();
basketShippingOptions$.subscribe((shippingOptions) => {
console.log('Available basket shipping options:', shippingOptions);
});
});
Basket Address API methods reference¶
- get
- setShipping
- setPickupPoint
- getSelectedShipping
- selectSelectedShipping
- getAvailableShippingCountries
- selectAvailableShippingCountries
- getSelectedShippingCountry
- selectSelectedShippingCountry
- setCountry
- getPaymentCostForActiveShippingByPaymentId
- selectPaymentCostForActiveShippingByPaymentId
- isEveryAvailablePaymentFree
- selectIsEveryAvailablePaymentFree
- getSectionValidation
- selectSectionValidation
- addMap
- showPickupPointMap
- shouldDisplayRemainingBasketValueForFreeShippingMessage
- addShippingInfo
- getShippingInfo