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.
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