In the following example, you want to create a new pricing engine that prices handling costs separately from shipping. You create a HandlingPricingEngine that acts independently of the ShippingPricingEngine.
Create an interface called
HandlingPricingEnginethat extendsPricingEngine.Create an implementation called
HandlingPricingEngineImplthat extendsPricingEngineService.Create a
HandlingPricingInfothat extends theAmountInfoprice holding class. (For more information, see AmountInfo.)Create a calculator called
HandlingPricingCalculatorand implementations of it that calculate and discount handling as your business requires.Modify the Promotions repository definition file (by default,
pricingModels.xml). Add an item-descriptor for the Handling discount type and sub-descriptors for the various implementations of theHandlingPricingCalculatorthat you created.Create properties files for the
HandlingPricingEngineand each of the calculators.
Your engine is ready for use. You may also want to add preCalculators that calculate the base cost of handling.

