Magento for B2B Commerce, 2.2.x

Creating Category Rules

Category rules dynamically change the product selection according to a set of conditions. Each categoryA set of products that share particular characteristics or attributes. can have only one category rule, although the single rule can have multiple conditions. For example, you can create a category rule for a specific brandA unique identity that defines a particular product or group of products.. Products of the same brand are automatically added to the list, even if they’re not assigned to the same category. You can add as many conditions to the expression as needed to describe the products that you want to include.

Each condition consists of an attributeA characteristic or property of a product; anything that describes a product. Examples of product attributes include color, size, weight, and price., value, and logical operator. Only attributes with the “Use in Product Listing” property set to “Yes” can be used in category rules. If you want to use an attribute that is not included in product listings, open the attribute in edit mode, and set “Use in Product Listing” to “Yes.” Although Date attributes are not supported, you can use the Date Created or Date Modified attributes to define a date, or range of dates. For example, to include only products that were created during the past week, set Date Created to a value of “<7.”

Make sure to configure each attribute that is used in the rule as a “smart” attribute.

Category Product Rule

Category product rules can speed up the process of assigning specific products to categories, based on conditions that determine which products appear in the category. The “smart” attributes that can be used with category product rules are specified in the Visual Merchandiser configuration.

Use caution when applying a category product rule, because any products that do not meet the condition are removed from the category. For example, if you create a rule that includes only purple tank tops, all other tank tops are removed from the category.

  • Menu Options



    Match products by rule

    Determines if the list of products in the category is dynamically generated by a category rule. Options: Yes / No

    Automatic Sorting

    Automatically applies a sorting order to the list of category products. Options:


    Move low stock to top

    Move low stock to bottom

    Special price to top

    Special price to bottom

    Newest products first

    Sort by color

    Name: A - Z

    Name: Z - A

    SKU: Ascending

    SKU: Descending

    Price: High to Low

    Price: Low to High

    Add Condition

    Adds an additional condition to the rule.



    Determines the attribute that is used as the basis of the condition. Options:

    Clone Category ID(s)

    Dynamically clones products from multiple categories based on Category ID.


    Includes products based on color..

    Date Created (days ago)

    Includes products based on the number of days since the products were added to the catalog.

    Date Modified (days ago)

    Includes products based on the number of days since the products were last modified.


    Includes products based on the product name.


    Includes products based on price.


    Includes products based on the quantity in stock.


    Includes products based on SKU.


    Specifies the operator that is applied to the attribute value to meet the condition. Unless an operator is specified, “Equal” is used as the default. Options:


    Not equal

    Greater than

    Greater than or equal to

    Less than

    Less than or equal to



    Specifies the value the attribute must have to meet the condition.


    The Logic column is used to define multiple conditions, and appears only when an additional condition is added. The operators follow the rules of precedence for MySQL boolean operators. Options:

    AND / OR