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 (storefront) => {
let basketProductsApi = storefront.getApiSync('basketProductsApi');
if (!basketProductsApi) {
const featureSystemApi = this.getApiSync('FeatureSystemApi');
await featureSystemApi.registerDynamic('basket');
basketProductsApi = storefront.getApiSync('basketProductsApi');
}
const validation = this._basketProductsApi.getSectionValidation();
});
Basket Products API methods reference¶
- get
- select$
- remove
- update
- getBasketCount
- selectBasketCount$
- getBasketPositions
- selectBasketPositions$
- getSum
- selectSum$
- getDiscountedSum
- selectDiscountedSum$
- selectSectionValidation$