Developer Documentation
Discount Engine Switch
Enable configuration switching between the Enticify and Commerce Server discount engine. This is very easy to support and is an important safety measure when going live with new functionality on a busy site.
Guide Assumptions
- You have a site that works with the CS discount engine.
- You have not integrated Enticify yet.
OR - You have integrated Enticify, but you still have a copy of the pre-Enticify PCF files.
Steps
- Make sure you have a copy of all the PCF files in your existing Commerce Server site that use the CS discount engine.
- Integrate Enticify into your CS site.
- Rename each PCF you modified to include Enticify components with a standard naming convention. For example
basket.pcf
could becomebasket_enticify.pcf
etc. - Restore the original versions of each of the modified PCF files, so you have
basket.pcf
(using the CS discount components) andbasket_enticify.pcf
(using the Enticify discount components). - Update your CS site
web.config
section to include the additional PCF files. Use the same standard naming convetion for the name
attribute. - Add a configuration switch to your site that indicates whether the site should use Enticify or Commerce Server. This could be in the web.config or your own configuration system.
- Modify your code that runs the pipelines to read the configuration switch and then select the appropriate pipeline(s) to run.
- Insert the
Enticify :: Zero Score Convention Configured Discounts
pipeline component immediately after theReservePromoCodes
pipeline component in the PCF files that use the Commerce Server Discount Components. This will score out any discounts that Commerce Server will not understand how to apply.
- You now have a site that supports switching the discount engine!