Related Videos
Product Rules #1 Introduction to Comestri Product Rules
Product Rules #3 Create Comestri Static Product Rule – Remove Category
Product Rules #4 Create Comestri Dynamic Product Rule – Add Category
Product Rules #5 Create Comestri Dynamic Product Rule – Remove Category
Video Summary
This video shows you how to create a Static Product Rule in Comestri that will add (i.e. assign) a Category to products automatically.
Video Transcript
In this video, you’ll be taken through creation of a Static Product Rule in Comestri.
You’ll see how a Static Product Rule allows you to add Categories to products automatically.
Before creating a Product Rule that assigns Categories to products, you’ll need to ensure that:
- The Categories you are assigning to products have already been created in the Comestri PIM
- The Attributes used in the Rule’s conditional logic statements also have already been created in the Comestri PIM
The Static Product Rule in this example will add Men’s and Women’s apparel products, which have a sale price, to the corresponding sale Category.
Before creating the example Product Rule, you’ll be shown some apparel products that will be affected by the Rule, and the Categories they are currently assigned to.
Welcome to Comestri. To begin, we will sign in to the Comestri application.
Click Products on the main menu. Then click Manage Products on the expanded menu.
The Manage Products page opens.
Here you can see a selection of products.
Next, you’ll see the Categories currently assigned to 2 of these products before you create the Product Rule.
The 2 products that will have Sale Categories assigned to them are: ‘Betsy dress blue’ and ‘Denim jeans black’.
To see the currently assigned Category for the dress, click the Product Code ‘betsy-dress-blue’.
The Edit Product page opens showing the General tab for the product.
Click the Categories tab.
You’ll see the Category ‘Sample Apparel AU: Womens > Apparel > Dresses’ has been assigned to this product.
Return to the Manage Products page, then click the Product Code ‘denim-jeans-black’ to check the Categories for your second product.
The Edit Product page opens showing the General tab for the product.
Click the Categories tab.
You’ll see the Category ‘Sample Apparel AU: Mens > Apparel > Jeans’ has been assigned to this product.
Next, you’ll create the Product Rule. Click Product Rules on the expanded menu. The Product Rules page opens.
Here you can see 2 existing Product Rules.
To create your Product Rule, click the New Product Rule button. The New Product Rule dialog box opens.
The Product Rule in this example will assign Sale Categories to Men’s and Women’s apparel products which have a sale price.
To start creating your Rule, select ‘Category assignment’ as the Rule type.
Next, enter a unique Code to represent this Product Rule. Here you’ll enter ‘Static Assign Sale Category to Products’.
Next, enter a descriptive Name for your Product Rule. Here, you’ll enter the same details as the Code.
In the Option field, you can select to either Add or Remove a Category assignment.
Here, you’ll select ‘Add’, since you’re adding a Category to each of the products.
Next, choose a Status for your Product Rule. An Active Rule will run automatically when a product is created or updated.
An Inactive Rule will not run automatically, but the Rule can still be triggered manually.
Here, you’ll select ‘Active’.
Result type can either be Static or Dynamic. You’re creating a Static Product Rule, so select ‘Static’ from the drop-down list.
For this Rule, leave the ‘Set Primary Category’ checkbox unselected.
For Classes, select the Product Classes this Rule will be run against. You must select the Class level that Categories are assigned to.
Here, you’ll select the ‘Colourway_’ Class.
To create a Rule, click the ‘+’ symbol and select ‘If statement’, as the logic in the Rule is built using IF-THEN-ELSE statements.
Each IF statement can have multiple conditions which are joined together by an ALL (AND) or ANY (OR) operator.
You can check if the conditions are TRUE or FALSE.
Click the ‘+’ symbol to add the first IF condition.
In this first condition, you’ll check IF the product’s Attribute, ‘Brand’, is Sample Apparel.
Select ‘ancestor1’ as context to apply this condition to the ‘Style_’ Product Class, which is the ancestor of the ‘Colourway_’ Class.
This means the condition will check against values stored on the ‘Style_’ Product Class level of the product.
Next, select ‘Brand’ from the drop-down list.
Then, select ‘is’ from the operator drop-down list.
Select ‘Sample Apparel’ from the drop-down list of values.
Add another IF condition to check that the ‘AU Sale Price’ of the product is greater than zero, i.e. the product has a Sale Price.
Select ‘self’ as context to apply this condition to the ‘Colourway_’ Product Class.
Next, from the product information drop-down list, select ‘AU Sale Price’.
Then, from the operator drop-down list, select ‘is greater than’.
Next, enter ‘0’ (zero) as the value.
For the THEN result, you’ll add an extra IF statement that will be used to check IF the ‘Gender’ Attribute’s value is ‘Womens’.
Start by clicking ‘+’ symbol and selecting ‘If statement’. Then click ‘+’ symbol to add a condition to the If statement.
Select ‘ancestor1’ as context to apply this condition to the ‘Style_’ Product Class, which is the ancestor of the ‘Colourway_’ Class.
Next, to check IF the ‘Gender’ Attribute’s value is ‘Womens’, select ‘Gender’ from the product information drop-down list.
Select ‘is’ as the operator from the drop-down list.
Enter ‘Womens’ in the value field.
Next, for this THEN result, you’ll add a ‘Result’ to assign a Category path to the products.
Select the Category path ‘Sample Apparel AU: Womens > Sale’ from the drop-down list.
For the ELSE result, click ‘+’ symbol to add an extra IF statement. This time you’ll check IF the ‘Gender’ Attribute value is ‘Mens’.
Next, click ‘+’ symbol to add the IF condition. In the context field, select ‘ancestor1’ from the drop-down list.
Then, to check the ‘Gender’ Attribute’s value is ‘Mens’, select ‘Gender’ from the drop-down list.
Select ‘is’ as the operator from the drop-down list.
Enter ‘Mens’ in the value field.
Next, for this THEN result, you’ll add a ‘Result’ to assign a Category path to the products.
Select the Category path ‘Sample Apparel AU: Mens > Sale’ from the drop-down list.
For the ELSE result, click ‘+’ symbol and add an extra ‘Result’. For this ‘Result’ you will not select a value. This closes the IF statement.
Lastly, click ‘+’ symbol and add a final ‘Result’. For this ‘Result’ you will not select a value. This closes the Product Rule.
Click Save.
The Product Rule is now listed on the Product Rules page.
Next, click the ‘Validate All Rules’ button to validate the Product Rule you have just created.
A slide-in message appears confirming the Product Rule Validation job is running.
Click Scheduled Jobs in the main menu to check the validation result.
The Scheduled Jobs page opens. Your Product Rule Validation job appears at the top of the list.
You’ll see the job Status is ‘Completed’ and the Result is ‘Success’ with zero Errors. This means your Product Rule will run.
Next, you’ll run your Product Rule. Click Product Rules in the main menu to return to the Product Rules page.
Click the checkbox next to your Product Rule and click the ‘Run Selected Rules’ button.
A dialog box opens warning you that running multiple Product Rules against all products may take several hours.
To continue running your Product Rule, click OK.
A slide-in message appears confirming your Product Rule is running in the background.
Click Scheduled Jobs in the main menu to check your Product Rule has run successfully.
The Scheduled Jobs page opens. Your Run Product Rules job appears at the top of the list.
You’ll see the job Status is ‘Completed’ and the Result is ‘Success’ with zero Errors. This means your Product Rule ran without errors.
Next, to check that your Product Rule generated the expected result, click Manage Products under Products in the main menu.
The Manage Products page opens.
Here you can see a selection of products.
Next, you’ll check that a Sale Category has been assigned to 2 of these products as a result of running your Product Rule.
The 2 products that you’ll check now have a Sale Category assigned to them are: ‘Betsy dress blue’ and ‘Denim jeans black’.
To see the newly assigned Category for the dress, click the Product Code ‘betsy-dress-blue’.
The Edit Product page opens showing the General tab for the product.
Click the Categories tab.
You’ll see the Category ‘Sample Apparel AU: Womens > Apparel > Sale’ has now been assigned to this product.
Return to the Manage Products page to check the Categories for your second product.
The Edit Product page opens showing the General tab for the product.
Click the Categories tab.
You’ll see the Category ‘Sample Apparel AU: Mens > Apparel > Sale’ has now been assigned to this product.
This completes the example of creating a Static Product Rule to add sale Categories to products.
What you’ve just seen is a simple Product Rule example.
Product Rules, however, are a very flexible tool that enable you to automate much more complex ways for adding and removing Categories.
For example, if you have multiple Product Class Structures, you can select a Product Class from each Structure for a Rule to be run against.