--- title: "Merchandising Rules" slug: "merchandising-rules" updated: 2025-08-06T07:55:54Z published: 2025-08-06T07:55:54Z canonical: "docs.xgen.ai/merchandising-rules" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xgen.ai/llms.txt > Use this file to discover all available pages before exploring further. # Merchandising Rules XGEN AI offers a code-free visual merchandising tool that allows users to control the display of products on XSearch and XRecommend Experiences using product attributes from their catalog and site information like real-time user behavior and current product information. ## Creating a Merchandising Rule There are two types of merchandising rules that can be created: - **Primary Filters**: Global rules that apply across all elements, and contain both filters and facets - **Stacked Filters**: Contextual rules (e.g. locale=fr-CA) applied on top of Primary Filters and do not contain filters on their own. This structure gives you greater control and flexibility when configuring your display logic. > [!NOTE] > Best Practice with Primary and Stacked Filters > > Keeping universal rules in the Primary and contextual rules in the Stacked filter to improve speed and reduce redundancy. ## Primary Filters ![Filters applied for categories and collection in a merchandising rule interface.](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/Merchandising Rules UI 07-1-2025.png) The Primary Filters feature allows users to create a Filter and a Facet using the same Rule. 1. **Filters**: Provides product display logic for use in [XSearch Experiences](/v1/docs/search-experiences) and XRecommend Experiences 2. **Facets**: Defines the related property that would be displayed to the shoppers that categorizes navigation in search results and product listing or collection pages ### Filter Conditions ![Filter options based off of property, operator, value, and string. Drag and drop controls in a white card-like user interface.](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/Screenshot 2025-06-30 at 2.53.50 PM.png) A filter is comprised of conditions and conditions are made up of logic strings. The logic starts with a property attribute from you catalog and is modified by an operator and a value, variable, user property or current product attribute. ### Logic Type | NAME/TYPE | DESCRIPTION | | --- | --- | | all | An `all` group must have all conditions met in order for the product to be valid. | | any | An `any` group needs any condition to be met in order for the product to be valid. | Use Groups to segment the all/any logic based on a particular group of conditions. ### Condition Types Product filters can be used in combination to build very specific display logic. Conditions are constructed in several parts using catalog attributes, real-time user behavior, and current product logic. The following data points represents a condition that must be met in order for a product to be valid as a result. | NAME/TYPE | DESCRIPTION | | --- | --- | | `property` string | The name of the product property to be used in the condition. | | `operator` string | The operator to be used in the condition (e.g. equals, contains, greater than, etc). | | `value` string \| number \| boolean \| string list | The value to be used in the condition that will be compared to the product property. | | `variable` string \| number \| boolean \| string list | Variable represents a key from a context object that will be used to get a dynamic value to be used in the condition that will be compared to the product property. | | `user property` | An on-site action taken by the user while browsing, including: - Viewed products [list of products] - Products in cart that haven't been purchased [list of products] - Most recent product added to cart [single product ID] - Most recent product added to cart category [attribute] - Products that are viewed more than once [list of products] - Products purchased [list of products] - Last viewed product [single product] - Last viewed product category [attribute] | | `Current Product Property` | A catalog product property or attribute of the product that is currently being viewed by the shopper. | ### Operator Types The following operators are available to be used in the conditions. | NAME/TYPE | DESCRIPTION | | --- | --- | | `equals` | The equals operator will check if the product property value is equal to the condition value. | | `doesn't equal` | The not equal operator will check if the product property value is not equal to the condition value. | | `contains` | The contains operator will check if the product property value contains the condition value. | | `doesn't contain` | The not contains operator will check if the product property value does not contain the condition value. | | `greater than` | The greater than operator will check if the product property value is greater than the condition number. | | `greater than or equal to` | The greater than or equal operator will check if the product property value is greater than or equal to the condition number. | | `less than` | The less than operator will check if the product property value is less than the condition number. | | `less than or equal to` | Checks if the product property value is less than or equal to the condition number. | | `matches regex` | Checks if the product property value matches the condition value regex string. | | `in` | A value of the property that can be found in any of the values given. | | `not in` | A value of the property that cannot be found in any of the values given. | ## Facets Primary Filters can include both Filters and Facets. Facets provide control over the `property` attributes that are related to products displayed within an XSearch experience. This `property` can be passed to the frontend of your customer experience for further contextualization and use in navigation. ![](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/Screenshot 2025-06-30 at 3.15.00 PM.png) ### Adding a Facet A new facet can hold multiple `property` conditions. Simply click on the “Add Facet” Button and choose from the drop down list of properties available. The order in which the facets appear in this list will be followed in your Navigation interface. You can easily drag and drop the facets in the order you prefer. ## Side Panel Preview ### Results Preview the results of your conditions in the right side panel by clicking the “Apply” button. ![](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/Screenshot 2025-06-30 at 2.40.14 PM.png) ### Search Your Catalog Search your entire product catalog using full, exact, case-sensitive product names. This mirrors the functionality of your [catalog page](/v1/docs/catalog-management) in the XGEN platform. Product codes are currently not supported in the search field. ### View Product Attributes & Meta Fields Click on the product cards in the right side panel to view it’s distinct product attributes. These meta fields are mapped to your catalog during onboarding and drive your merchandising rules. ![](https://cdn.us.document360.io/ae46ce4b-af2c-4789-b3ad-1d1ccd16b4a1/Images/Documentation/Screenshot 2025-06-30 at 2.46.37 PM.png) --- ### FAQ #### What is the difference between a Primary Filter and a Stacked Filter? The two types of merchandising rules are Primary Filters and Stacked Filters. Primary Filters allow users to create a Filter and a Facet using the same Rule, providing product display logic for XSearch Experiences and defining related properties for navigation in search results. Stacked Filters are contextual rules applied on top of Primary Filters, capable of being scoped by locale. #### Is it possible to search my entire product catalog within the Merchandising Rules page? Yes, you can search your entire product catalog using full, exact, case-sensitive product names, although product codes are not supported in the search field. #### What information can I view about a product in the side panel? In the side panel, you can view distinct product attributes and meta fields that are mapped to your catalog during onboarding.