on 2019 Jan 29 8:30 AM
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.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.