The Vue Storefront Essentials Course is now available! Learn More
Attributes normalizer

Attributes normalizer

Attributes are Unified Data Layer representation of SFCC VariationAttribute qualifiers. The normalizeAttributes function maps all qualifiers in VariationAttribute along with VariationValues into an array of SfAttribute.

Parameters

NameTypeDefault valueDescription
variantVariationValuesSFCC Product (or Variant)
variationAttributesVariationAttributeSFCC VariationAttribute

Extending

The SfAttribute is returned as a part of SfProduct and SfCart.

If you want to change the global attributes representation, you should override both - the normalizeProduct, and normalizeCart functions. Overriding the normalizeAttributes function will not have an impact of the attributes normalization inside these functions, it is just an utils function which may be then used in writing other custom normalizers or methods.

Source

🔴 ../../node_modules/@vsf-enterprise/unified-api-sfcc/src/normalizers/attributes/attributes.ts | Snippet does not exist 🔴