In the following example, you have decided 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.

  1. Create an interface called HandlingPricingEngine that extends PricingEngine.

  2. Create an implementation called HandlingPricingEngineImpl that extends PricingEngineService.

  3. Create a HandlingPricingInfo that extends the AmountInfo price holding class. (For more information, see AmountInfo.)

  4. Create a calculator called HandlingPricingCalculator and implementations of it that calculate and discount handling as your business requires.

  5. 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 the HandlingPricingCalculator that you created.

  6. Create properties files for the HandlingPricingEngine and each of the calculators.

  7. Depending on your needs, configure the new engine with some preCalculators that calculate the base cost of handling.

 
loading table of contents...