volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Calculating discounted price

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

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

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.