Skip to content

getSectionValidation(): TSectionValidation

The getSectionValidation method allows to validate a section containing products and check for potential errors.

Returned value

A returned value has a type of TSectionValidation representing an object that tells whether a section was successfully validated or not.

Example

In this example we make a basketProductsApi call to validate a section containing products and check for potential errors.

useStorefront(async ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketProductsApi = await getApi('basketProductsApi');

        const validation = basketProductsApi.getSectionValidation();
    });
});

Basket Products API methods reference

Objects reference