Skip to content

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

        const shippingInfo = basketShippingsApi.getShippingInfo();
    });
});

Basket Address API methods reference

Models reference