Promotion Product Rule Attribute Conditions

When importing your catalog, make sure to consider product attributes.

Although product attributes can be numeric, the product attribute value is only a string. Strings are the lowest common denominator of all supported attribute types. The import logic validates operator and attribute values based on metadata definitions. These definitions are similar to what exist for custom product attributes in catalog imports.

The following are the validation rules:

  • Attribute IDs, operators, and values are checked using XML schema validation and must not be empty strings.
  • The attribute-id value is used to retrieve the attribute definition from the Product system object type. If no such attribute definition exists, the condition is skipped.
  • If the attribute condition type is not supported, the condition is skipped.
  • If an attribute condition supports only one value, and multiple values appear in the XML, a warning is logged and the first value is used.
  • Only supported operators are allowed (value types). If an unsupported operator is detected, the attribute condition is skipped.
  • If one of multiple values is invalid, the entire attribute condition is skipped.

This table illustrates the validation rules.

Value Type Value Multiple 'attribute-value' elements allowed? Operator
String - yes -
Integer numeric value without decimal places no Operator "less than" is mapped to internal operator "less than or equals". Operator "greater than" is mapped to internal operator "greater than or equals".
Boolean value equals to 'true' or 'false' no -
Set of String - yes -
Set of Integer numeric value without decimal places no Operator "less than" is mapped to internal operator "less than or equals". Operator "greater than" is mapped to internal operator "greater than or equals".
Enum of String one of the values of attribute definition no -
Enum of Integer numeric value without decimal places no Operator "less than" is mapped to internal operator "less than or equals". Operator "greater than" is mapped to internal operator "greater than or equals".

This table shows how B2C Commerce evaluates attribute conditions based on their type.

Value Type Supported Operators Multiple Values Supported Client-side Value Editor Sample Condition
String equals yes (OR combined) text field product attribute "size" equals "10"
Integer greater than or equals, equals, less than or equals no text field product attribute "size" greater than or equals "4"
Boolean equals no combo box product attribute "enabled" is "true"
Set of String equals yes (OR combined) text field product attribute "Image Aspect Ratio" equals "16:9"
Set of Integer greater than or equals, equals, less than or equals no text field product attribute "width" greater than or equals "3"
Enum of String equals no combo box product attribute "weight" equals "27 lbs"
Enum of Integer greater than or equals, equals, less than or equals no combo box product attribute "width" equals "3"