Optimize promotion engine for discount evaluation

Fixed in

EPiServer.Commerce 13.25.0


Jul 23, 2020


Dec 15, 2021


Closed, Acceptance tests pass


Displaying discount prices on a product listing uses the same logic as evaluating promotions on a cart, basically running the promotion engine with a virtual cart containing one item. It will run through all the steps of evaluation, including filtering for redemption limits etc.

In order to improve this mechanism, to get discounted prices for product listing, a cache has been added to IPromotionEngine extension methods (IPromotionEngineExtensions) so that it reduces loads from the database.