Create Comestri Static Product Rule – Remove Category

Related Videos

Product Rules #1 Introduction to Comestri Product Rules

Product Rules #2 Create Comestri Static Product Rule – Add 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 remove a Category from 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 remove a Category from products automatically. 

This is the simplest way of removing a Category from products using a Product Rule. 

(Removing a Category from products using a Dynamic Product Rule is more complicated and will be covered in a separate video.)

This Static Product Rule will remove Men’s and Women’s sale Categories from products automatically when their sale price is deleted. The Product Rule will do this by checking whether the sale price has been deleted (i.e. is ‘null’). 

Sometimes users reduce a sale price to zero in the mistaken belief that this deletes the sale price. To handle this error, the example Product Rule will also check whether the sale price on the product ‘is less than or equal to zero’.

Before creating the example Product Rule, you’ll be shown some apparel products with sale prices and the Categories they are currently assigned to. 

You’ll then be shown that the sale Category for each product is removed by the Rule when the product’s sale price is deleted.

This Product Rule will be triggered automatically when the sale price of a product is deleted (either manually via the Comestri UI, via CSV upload or by integration) or the sale price becomes inactive (i.e. falls outside an assigned ‘from’ and ‘to’ date). 

In this example, we’ll be deleting the sale price manually via the Comestri UI, then creating the Product Rule and triggering it.

In most cases, you would create the Product Rule first. Then later, when the sale price is deleted, the Product Rule will be triggered automatically. 

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 removed from them are: ‘Betsy dress blue’ and ‘Denim jeans black’. 

To see the currently assigned Categories 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 Categories ‘Sample Apparel AU: Womens > Apparel > Dresses’ and ‘Sample Apparel AU: Womens > Sale’ are assigned. 

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 Categories ‘Sample Apparel AU: Mens > Apparel > Jeans’ and ‘Sample Apparel AU: Mens > Sale’ are assigned. 

Next, you’ll see the various prices currently assigned to the 2 products and then you’ll delete their sale prices. 

Return to the Manage Products page. 

Then click the Product Code ‘betsy-dress-blue’. 

The Edit Product page opens showing the General tab for the product. 

Click the Prices tab to see the current prices listed for the product. 

To delete the AU Sale price manually, click the ellipsis on the right and select ‘Delete’. 

A dialog box opens asking if you are sure you want to delete the price. Click OK. 

You can now see that the AU Sale price has been deleted. Price changes are saved automatically. 

Return to the Manage Products page, click the Product Code ‘denim-jeans-black’. 

The Edit Product page opens showing the General tab for the product. 

Click the Prices tab to see the current prices listed for the product. 

To delete the AU Sale price manually, click the ellipsis on the right and select ‘Delete’. 

A dialog box opens asking if you are sure you want to delete the price. Click OK. 

You can now see that the AU Sale price has been deleted. Price changes are saved automatically. 

Next, you’ll create the Product Rule. Click Product Rules on the expanded menu. The Product Rules page opens. 

Here you can see 3 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 remove the assigned Sale Categories from Men’s and Women’s apparel products. 

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 Remove Sale Category from 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 ‘Remove’, since you’re removing a Category from 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 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. 

For the THEN result, you’ll add an extra IF statement with 2 conditions. 

Here, the Rule will check whether the ‘AU Sale Price’ of the product is ‘null’, i.e. the product doesn’t have a Sale Price. 

Or, whether the ‘AU Sale Price’ of the product is ‘less than or equal to’ 0 (zero). 

Start by clicking ‘+’ symbol and selecting ‘If statement’. Then click ‘+’ symbol to add a condition to the If statement. 

Here, the IF conditions will be joined together by an ANY (OR) operator, as you’re checking for products that satisfy either of the conditions. 

Here, you’re checking if the conditions are TRUE. 

Click the ‘+’ symbol to add the first IF condition. 

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 null’. 

Click the ‘+’ symbol to add the second IF condition. 

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’ again. 

Then, from the operator drop-down list, select ‘is less than or equal to’. 

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. 

Next, in the context field, select ‘ancestor1’ from the drop-down list. 

Then, 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 remove a Category path from 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 remove a Category path from 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. 

For the ELSE result, click ‘+’ symbol and add an extra ‘Result’. For this ‘Result’ you will also 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 either. 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 the Sale Category has been removed from 2 of these products as a result of running your Product Rule. 

The 2 products you’ll check are: ‘Betsy dress blue’ and ‘Denim jeans black’. 

To see that the Sale Category has been removed from 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 removed from 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 removed from this product. 

This completes the example of creating a Static Product Rule to remove sale Categories from 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.