You can replace the standard implementations of the pricing engines with your own. For example, you might want to create a pricing engine that prevents people from using certain discounts at the same time while also making sure they use the best discount available. For example, if your site is running a “Buy one pair of shoes, get a second pair free” promotion, you can create an engine that prevents a customer from using a “25% off any full-price item” promotion during the same period. In addition, the engine could ensure that the customer always uses the promotion that provides the greater savings. In this example, if one pair of shoes costs $150 and the second pair only $30, the better promotion would be the one that provides a 25% discount on the shoes that cost $150.

For each engine with this behavior, write a new implementation of its interface. In the new implementation, include a getPricingModels method that constructs and returns a Collection in order to aid in the algorithm. For example, replacing ItemPricingEngineImpl involves implementing ItemPricingEngine.

 
loading table of contents...