Enabling rule-based sales categories
You can enable rule-based sales categories so that business users can apply the rules for rule-based sales categories in the Catalogs tool. When you are enabling rule-based sales categories, you can also configure properties to control how to automatically reapply the rules for rule-based sales categories.
For more information about administering rule-based sales categories, see Rule-based sales category overview.
By default, business users can create, change, and delete rule-based sales categories and define the rules for the categories, but they cannot apply the rules. Before a business user can apply the rule for finding and assigning catalog entries, you must enable the evaluation and application of rule-based sales category rules.
When you are updating your custom catalog component configuration file, you can also configure the values that control automatically reapplying the rule for each category.
Procedure
-
Go to the following directory and open your custom wc-admin-component.xml
catalog component configuration file for editing:
- workspace_dir\WC\xml\config\com.ibm.commerce.catalog-ext
Note: If the custom com.ibm.commerce.catalog-ext directory and wc-admin-component.xml file does not exist for your site, you must create the directory and file. -
Go to the following directory and open the default wc-admin-component.xml
catalog features component configuration file:
- workspace_dir\WC\xml\config\com.ibm.commerce.catalog
RuleBasedCategoryConfiguration
configuration grouping in this file includes the configurable properties that are specific to rule-based sales categories. -
Copy the following
RuleBasedCategoryConfiguration
configuration grouping from the default wc-admin-component.xml configuration file into the corresponding location in your custom wc-admin-component.xml configuration file.
The comments in the file are omitted for readability.<_config:configgrouping name="RuleBasedCategoryConfiguration"> <_config:property name="evaluationEnabled" value="false" /> <_config:property name="evaluationHostname" value="" /> <_config:property name="evaluationTimeInterval" value="-1" /> </_config:configgrouping>
-
In your custom wc-admin-component.xml configuration file, enable the
evaluationEnabled
configurable property by setting the value for the property to"true"
.This property indicates whether the rules for rule-based categories can be applied to the categories. This setting applies for all rule-based sales categories in the system. When the rule is applied to a category, HCL Commerce search uses the rule to find catalog entries that match the search filters in the rule. The catalog services then assign the catalog entries to the category. The resulting relationships between the catalog entries and the category are stored in the CATGPENREL database table.When this property is enabled, a check is performed to determine whether the
EvaluateRuleBasedCategories
job is being run in a production environment. If the environment that you are running theEvaluateRuleBasedCategories
job within does not have workspaces or a configured staging environment, theevaluationEnabled
property is disabled. This check ensures that the rule does not get reapplied in the production environment. If rules need to be defined for assigning catalog entries that exist only in a production environment, copy the data from the product environment to the authoring environment. By applying the rules for a category in an authoring environment, the application of the rule can be tested and approved before the category is propagated to production.Note: You can reset the enablement configuration setting and other rule-based sales category configuration settings by changing the values for the properties and refreshing theRuleBasedCategoryConfiguration
registry in the Administration Console.If your custom wc-admin-component.xml file includes only theRuleBasedCategoryConfiguration
grouping, the contents of your file can look like the following file:<_config:DeploymentConfiguration xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-admin-component.xsd"> <_config:extendedconfiguration> <_config:configgrouping name="RuleBasedCategoryConfiguration"> <_config:property name="evaluationEnabled" value="true" /> <_config:property name="evaluationHostname" value="" /> <_config:property name="evaluationTimeInterval" value="-1" /> </_config:configgrouping> </_config:extendedconfiguration> </_config:DeploymentConfiguration>
- Optional:
Configure the properties that control the use of a
EvaluateRuleBasedCategories
job for automatically reapplying rule-based sales category rules. By configuring these properties, the rule evaluation and application job can run automatically after a configured amount of time elapses from the last time that the rule was evaluated. - Save and close the file.
- Optional:
Configure the maximum number of catalog entries that can be returned by HCL Commerce Search to be assigned to a rule-based sales category.
The value for this property sets an upper limit for the number of catalog entries that can be assigned in case a business user does not set a maximum value in the Catalogs tool for a category, or sets the value too high. The count for this limit is based on the products, bundles, kits, and category-level SKUs that match the search filter conditions and are specified by a business user.If the elastic search is enabled, change the value for
"maxRows"
in the HCL_salesCatalogDynamicCatalogEntryRecommendation search profile. TheHCL_salesCatalogDynamicCatalogEntryRecommendation profile can be accessed through the profiles endpoint on the data query service.GET - http://<dataQueryHost>:<dataQueryPort>/search/resources/api/v2/documents/profiles/HCL_salesCatalogDynamicCatalogEntryRecommendation
The above request will return the profile in JSON format. To override the same profile, modify the
"maxRows"
value.The profile is created using the PUT request method of the profile's endpoint by sending the request body in JSON format.Note: A restart of the query service is required. - Test your configuration changes.