The B2C Commerce Script API supports variation groups.
Use the Script API with variation groups as follows: When reading attribute values, when there’s a fallback from a variation product to base product in the case the variant doesn't define an attribute value. There’s no fallback from variation product to variation group if the variation product doesn't define an attribute value. However, there’s a fallback from a variation group to a base product in case the variation group doesn't define an attribute value.
-
dw.catalog.Variantclass has attribute fallback behavior to first obtain attributes from (one or more) assigned variation groups and then from the base product. -
dw.catalog.VariationGroupclass has attribute fallback behavior to obtain attributes from the base product, when the attribute isn't specified by the variation group. -
dw.catalog.Productclass checks if the product is of type variation group through the public booleanisVariationGroup();method. -
dw.catalog.Productclass returns all assigned variation groups of a base product through the public CollectiongetVariationGroups();method. -
dw.catalog.ProductVariationModelclass returns all assigned and online variation groups of the corresponding base product via the public CollectiongetVariationGroups(); method. -
dw.catalog.ProductVariationModelclass returns configured variation values for variation group products via the publicProductVariationAttributeValuegetVariationValue( Product variantOrVariationGroup, ProductVariationAttribute attribute); method.