Creating a New Pricing Engine
If you want to create a new pricing engine that prices Sample costs separately from shipping. You create a SamplePricingEngine that acts independently of the ShippingPricingEngine.
- Create an interface called SamplePricingEngine that extends PricingEngine.
- Create an implementation called SamplePricingEngineImpl that extends PricingEngineService.
- Create a SamplePricingInfo that extends the atg.commerce.pricing.AmountInfo price holding class.
- Create a calculator called SamplePricingCalculator and implementations of it that calculate and discount Sample as your business requires.
- Modify the Promotions repository definition file (by default, pricingModels.xml). Add an item-descriptor for the Sample discount type and sub-descriptors for the various implementations of the SamplePricingCalculator that you created.
- Create properties files for the SamplePricingEngine and each of the calculators.
- Your engine is ready for use. You may also want to add preCalculators that calculate the base cost of Sample.
No comments:
Post a Comment