1
votes

I want to learn which promotions were applied to which products on promotionengine in order to distribute prices on products amongst themselves and send them to ERP.

When we look at the promotionService in Hybris, there is a method called getPromotionResults(order). It returns PromotionOrderResults object. In this object, two methods are related to my case, getAppliedProductPromotions() and getAppliedOrderPromotions(). If I did not miss it, I could not see product info for a promotion in these methods' results. Also, I looked at all attributes via promotion.getAppliedOrderPromotions().get(0).getAllAttributes() but i could not have them.

How can I know product info and discount amount in a promotion?

1
are you still using legacy promotions? or the new rule-based promotion engine?Sukram
I already told it above as promotionengine. I mean, it is drools-based promotionengineHatip Kabak

1 Answers

0
votes

The method you are looking for is

PromotionOrderResults#getAppliedProductPromotions()

This will return all the promotions applied to order entries / products, you can navigate to the products via PromotionOrderEntryConsumed PromotionResult#getConsumedEntries()