5 Replies Latest reply on Oct 17, 2012 6:48 AM by 965889

    Apply promotion with highest priority

      Hello guru. Help me please.

      I use ATG 10.0.3 and have a problem: when I create two equal promotions, but first has priority = 1, and secont = 3. When my order suited to the conditions, bouth promotions are used. And I want, that the promotion with the highest priority was used. Do you know eny ways to do this

        • 1. Re: Apply promotion with highest priority
          Nitin Khare
          When applying promotions, the pricing engine internally creates a list of promotions by combining global promotions and the promotions from current profile's activePromotions property. The pricing engine then applies promotions from this list based on priority. Lower the number in priority property value, higher would be the promotion priority. Promotion having the highest priority will be applied first then the one with next priority and so on. This is the default behavior.

          For your case I think using your own promotion vetoer implementation might be one option you may want to explore further for excluding a promotion based on its priority:


          It is available in 10.0.3 as well and ATG provides one OOB implementation for PricingModelEvaluationVetoer which is for vetoing a promotion if it is not valid for the current site. You can create your own implementation for PricingModelEvaluationVetoer and add it to the pricingModelEvaluationVetoers property of PricingEngineService. Your PricingModelEvaluationVetoer implementation can have the logic to check the current promotion priority with other promotion.

          If you were on ATG10.1+, then you could have tried using "Stacking Rules" functionality in Merchandising. There you can create stacking rules and link your different priority promotions to different stacking rules. So if an order qualifies for more than one promotion and those promotions are linked to mutually exclusive stacking rules, the promotion with the highest priority is applied and all other promotions are skipped.


          But I guess Stacking Rules would not be available in 10.0.3 so you can try for PricingModelEvaluationVetoer implementation as mentioned above.

          Edited by: Nitin Khare on Oct 3, 2012 8:01 AM
          1 person found this helpful
          • 2. Re: Apply promotion with highest priority
            I have read about Stacking Rules but in is new feature of ATG10.1.
            I wil try to use PricingModelEvaluationVetoer
            • 3. Re: Apply promotion with highest priority
              Veto promotions works good. But another problem is happened. In method vetoPromotion I can get list of al enable promotion by type(Shipping, Order or Item). But some of them won't be used cause of conditions. For example: I have two promotion. 1 - free shipping if you spend 300$ in order(priority=3), 2 - free shipping in London(priority=1). If I live in Milan, I will see both promotions in vetoPromotion. And I will veto 1-st, because of priority. And 2-d will be not used because of conditions on calculation step.
              Is were any way to know, will promotion apply to order or not?
              • 4. Re: Apply promotion with highest priority
                Nitin Khare
                Glad that it works for you. I do hope you should be making use of both the methods of PricingModelEvaluationVetoer - prepareForVetoing() for preparing the vetoer and vetoPromotion() to actually veto the promotions in PricingContext. Just throwing some ideas - see if you can also make use of PromotionTools utility methods to exactly meet your requirements or may be get the Qualifier from PromotionTools and try using one of those filterX or findQualifyingX methods. Hope it helps.
                1 person found this helpful
                • 5. Re: Apply promotion with highest priority
                  Thanks a lot. No everything works good