Feature Pack 6Feature Pack 5Feature Pack 7

Troubleshooting: Customer can use unique promotion codes multiple times

If your store uses single-use unique promotion codes, it can be possible for customers to use the same code in multiple orders. For instance, if they are placing orders concurrently in different browsers.

Problem

If a shopper is creating multiple orders at a time and adds the same single-use unique promotion to multiple orders, it is possible for the shopper to complete the orders and redeem the promotion code multiple times. This multiple redemption can occur because there is no validation on the promotion codes before the order is placed.

Solution

You can prevent multiple redemption of a single-use unique promotion code by adding a validation check for unique promotion codes before orders are placed. To add this validation to your site, you must apply the appropriate maintenance interim fixes:

The fix adds a task command, ValidateUniquePromotionCodesTaskCmdImpl to your system. The promotion engine can use this command to validate whether a unique promotion code in an order is unused at the time the order is placed. If a unique code is already redeemed at the time the order is placed, the check prevents the unique code from being redeemed again.

To enable the promotion engine to use the new ValidateUniquePromotionCodesTaskCmdImpl command for a store, register the command by completing the following steps:
  1. Open a connection to your database, and run the following SQL insert statement to add the command to the command registry for a store:
    Insert into CMDREG (STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET) 
    VALUES (0,'com.ibm.commerce.promotion.facade.server.commands.ValidateUniquePromotionCodesTaskCmd',
    'com.ibm.commerce.promotion.facade.server.commands.ValidateUniquePromotionCodesTaskCmdImpl','Local'); 
  2. Update and refresh the promotion component registry. Alternatively, you can restart your WebSphere Commerce server.
Note: If you want to disable this validation, remove the entry from the CMDREG table and refresh the registry.