getShippingInfo(shipping: BasketShipping) HTMLTemplateElement | undefined¶
The getShippingInfo
method allows to retrieve the shipping information from the basket.
Returned value¶
A returned value has a type of HTMLTemplateElement | undefined
that represents the template of the shipping that can be later displayed.
Example¶
In this example we make a basketShippingsApi
call to retrieve the shipping information from the basket.
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 shippingInfo = basketShippingsApi.getShippingInfo();
});
Basket Address API methods reference¶
- get
- select
- setShipping
- setPickupPoint
- getSelectedShipping
- selectSelectedShipping
- getAvailableShippingCountries
- selectAvailableShippingCountries
- getSelectedShippingCountry
- selectSelectedShippingCountry
- setCountry
- getPaymentCostForActiveShippingByPaymentId
- selectPaymentCostForActiveShippingByPaymentId
- isEveryAvailablePaymentFree
- selectIsEveryAvailablePaymentFree
- getSectionValidation
- selectSectionValidation
- addMap
- showPickupPointMap
- shouldDisplayRemainingBasketValueForFreeShippingMessage
- addShippingInfo