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

  1. Make sure you have a copy of all the PCF files in your existing Commerce Server site that use the CS discount engine.
  2. Integrate Enticify into your CS site.
  3. Rename each PCF you modified to include Enticify components with a standard naming convention. For example basket.pcf could become basket_enticify.pcf etc.
  4. Restore the original versions of each of the modified PCF files, so you have basket.pcf (using the CS discount components) and basket_enticify.pcf (using the Enticify discount components).
  5. Update your CS site web.config section to include the additional PCF files. Use the same standard naming convetion for the name attribute.
  6. 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.
  7. Modify your code that runs the pipelines to read the configuration switch and then select the appropriate pipeline(s) to run.
  8. Insert the Enticify :: Zero Score Convention Configured Discounts pipeline component immediately after the ReservePromoCodes 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.
  9. You now have a site that supports switching the discount engine!