Promotion code manager

The promotion code manager records promotion codes that a customer enters for an order. The promotion code manager is a configurable component of the promotion engine. By default, the promotion component supports a one-to-one mapping between promotion codes and promotions.

When a customer enters a promotion code for a promotion on the storefront, this indicates that the customer is explicitly requesting this promotion. Therefore, this promotion takes precedence over any promotions for which the customer did not enter a promotion code. This behavior is built into the sequence builder code. The following XML fragment is used to configure the promotion code manager in the promotion engine configuration:


<PromotionCodeManager impl="com.ibm.commerce.marketing.promotion.code.DefaultGenericPromotionCodeManager">
 <PromotionCodeResolver impl="com.ibm.commerce.marketing.promotion.code.MultipleCodesPromotionCodeResolver">
    <Separator>|</Separator>
 </PromotionCodeResolver>
</PromotionCodeManager>

All promotion code managers must implement the following interface: com.ibm.commerce.marketing.promotion.code.PromotionCodeManager.

The implementation relies on a configurable component called a PromotionCodeResolver to decipher a promotion code. The Separator element in the PromotionCodeResolver defines the character used to delineate multiple promotion codes for a promotion. If you are defining a promotion that accepts multiple codes, separate them using this character. If you would like to use a different character, define the new character using this element.

The PromotionCodeResolver will likely require changes if a custom promotion code application is used.