Promotion code manager

When a promotion code is entered for a promotion, it indicates that the customer is explicitly requesting this promotion. Therefore, this promotion takes precedence over any promotions for which no promotion code is entered. This behavior is coded into the sequence builder discussed earlier in this document.

The default promotion system supports a one-to-one mapping between promotion codes and promotions. Promotion code management is handled by a configurable component of the promotion engine, called a PromotionCodeManager. The following XML fragment is used to configure the PromotionCodeManager 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.

Related concepts