GetDiscountPrices method does not return results if a Promotion code value is present

Vote:
 

Hi,

I am using Commerce 12.15, I have a scenario where I want to see all the applicable promotions and I use GetDiscountPrices method.

var discountedPrice = ServiceLocator.Current.GetInstance<IPromotionEngine>().GetDiscountPrices(entry.ContentLink, currentMarket, new Currency("USD"));

I am facing an issue where the method returns a 0 count if the promotion has a promo code text. It returns the count correctly, if the promotion does have a promo code text.

Below are two example screen casts:

https://www.screencast.com/t/Ajh3g09f768d (Promotion code field is blank)

https://www.screencast.com/t/04auKGzADSl (Promotion code field is not blank)

I am expecting the GetDiscountPrices method to return all applicable promotions, and that doesnt seem to be the case if the promotion code field is not blank.

#202922
Edited, Apr 03, 2019 23:58
Vote:
 

That is the expected behavior, GetDiscountedPrice returns promotions that can be applied for an individual item with quantity = 1, and without any promotional codes (coupons). If you want to get applicable promotions with coupon, you can create an ordergroup, add that item to it as line item and add coupons to that order form, then run IPromotionEngine.Evaluate

#202933
Apr 04, 2019 5:16
Vote:
 

Thanks Quan!

#202957
Apr 04, 2019 14:25