London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Calculating discounted price

Vote:
0

Hi

How can you calculate the discounted prices for a diferent customer group/price group?

private IEnumerable<DiscountedEntry> GetDiscountedPrices(ContentReference contentLink, IMarket CurrentMarket, IBaseContext context)
{
var promotionEngine = container
.With<PromotionEngineContentLoader>(container.With(context)
.GetInstance<CustomPromotionEngineContentLoader>())
.GetInstance<IPromotionEngine>();

return promotionEngine.GetDiscountPrices(
new[] { contentLink },
CurrentMarket,
CurrentMarket.DefaultCurrency,
referenceConverter,
lineItemCalculator);
}

#206860
Sep 02, 2019 13:37
Vote:
0

As far as i recall you can't, the promotion engine takes the customer information directly from the http/customer context.

#207073
Sep 09, 2019 16:30
Vote:
1

I took the time and wrote up a feature request:
https://world.episerver.com/forum/developer-forum/Feature-requests/Thread-Container/2019/9/evaluate-prices-for-specific-customer-or-visitor-groups/
Please upvote it if you would like episerver to implement it. ^^

#207168
Sep 11, 2019 16:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.