Skip to content

getSectionValidation(): TSectionValidation

The getSectionValidation method allows to validate the shipping section of the basket.

Returned value

A returned value has a type of TSectionValidation.

Example

In this example we make a basketShippingsApi call to validate the shipping section of 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 sectionValidation = basketShippingsApi.getSectionValidation();
});

Basket Address API methods reference

Objects reference