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!
AI OnAI Off
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!
As far as i recall you can't, the promotion engine takes the customer information directly from the http/customer context.
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. ^^
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);
}