Skip to Content
May 17, 2018 at 09:05 AM

How to restrict product promotions being applied on cart


Hello Team,

We are working on hybris 6.5 and We have a use case to apply either custom discount (derived dynamically from external system) or apply promotional discount which ever is highest on cart.

I cant use OOTB restriction on a single promotion, as i have to consider sum of all promotional discounts vs my custom discount.

My question is, is there a way to get sum of all the product promotional discounts on cart, before applying them on cart?

I tried OOTB methods with AutoApplyMode as APPLY_NONE and KEEP_APPLIED, I see both of them applying the discounts on cart, and the mode is not considered in super method, updatePromotions and in updatePromotionsNotThreadSafe.

  1.   PromotionOrderResults resultsWithApplyNone = getPromotionsService().updatePromotions(getPromotionGroups(),
                                         childCart, true,
  2. PromotionOrderResults resultsWithKeepApplied = getPromotionsService().updatePromotions(getPromotionGroups(), childCart, true, de.hybris.platform.promotions.jalo.PromotionsManager.AutoApplyMode.KEEP_APPLIED, de.hybris.platform.promotions.jalo.PromotionsManager.AutoApplyMode.KEEP_APPLIED, getTimeService().getCurrentTime());

Regards, Sandeep