cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Where actual promotion evaluation takes place

Former Member
0 Kudos
852

DefaultCommerceCartCalculationStrategy->PromotionEngineService(updatePromotions)->DefaultCommerceRuleEngineService(evaluate)>DefaultPlatformRuleEngineService(evaluate) I know this flow but i dont understand the code inside those methods. I want to know when we add a category condition in a promotion, where exactly in code Hybris checks if the product belongs to that category or not.

Please help me with this.The code looks very complex to understand.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The check is actually done by the Drools Rule engine. You should understand that there are 2 steps:

  • The bean 'qualifyingCategoriesConditionTranslator' will generate the a Drools Rule. This steps happens when you PUBLISH the promotion in the backoffice.

  • At EVALUATION time (or in other words, the moment that your cart is recalculated). The "generated droolsrule" is evaluated. It uses RAO objects like "CategoryRAO", "ProductRAO", "OrderEntryRAO" to evaluate the the Drools rule.

Former Member
0 Kudos

Hi Abinash,

I never work on 6.5,but as per 6.7 working experience promotions conditions build through "RuleConditionDefinition" .

Here RuleConditionDefeination required translator Id (Spring bean id)

    INSERT_UPDATERuleConditionDefinition;id[unique=true];name[lang=$lang];priority;breadcrumb[lang=$lang];allowsChildren;translatorId;translatorParameters;categories(id)
        ;y_qualifying_categories;Qualifying categories;1000;Cart {categories_operator} categories {categories};false;qualifyingCategoriesConditionTranslator;;cart


If want understand total flow, practice below trail.

https://help.hybris.com/6.7.0/hcd/39b59b51c229400099d8ee0d0a79cdf5.html