Overview of creating a new promotion type

To create a new promotion type, there are 4 steps.

  1. Determine what kind of promotion your store requires. WebSphere Commerce provides a rich set of default promotion types, including purchase conditions which apply to the product level or order level. The rewards target individual products, the entire order, or the related shipping charges. An additional default promotion type is called purchase with purchase, in which a customer who purchases some item (or product, or category), and gets some other item at a discount. Comparing your requirements against the existing promotion to determine whether you can reuse some elements of the default promotions could simplify your customization, saving the time to invent an entirely new promotion type.

    While the most common promotion customization scenario focuses on changing either the purchase condition or the reward, if your necessary customization implements a condition other than the purchase condition, refer to custom conditions.

    The purchase condition contains two key elements: a qualification criteria that is compared to the the shopping cart, and a reward that is given to the customer if the qualification criteria is met. This purchase condition, as part of the larger promotion definition, is represented as XML. To see a sample purchase condition defined using XML, refer to the promotionXML example.

    If your promotion type combines one of the default promotion conditions with a reward from a different default promotion, such as "buy 3 of item A, get free shipping using the express shipping method", which combines an item level purchase condition and a shipping level reward, you can build your own promotion by merging the purchase condition from the "Product Level Percentage Off" promotion type, and the reward from the "Discounted Shipping" promotion.

  2. Understand the promotion XML presentation and build it. Refer to the promotionXML example. This promotion XML sample explains the usage of the major XML nodes in one promotion. In addition, the Add support for a custom promotion type example further explains some of the options available in terms of replacing or customizing the existing nodes. The Promotion Name, Store Key, Version, and Revision XML elements comprise the unique index of a promotion. Most customization scenarios can be achieved by updating the elements under the <PurchaseCondition> node. To better understand the <PurchaseCondtion> element, refer to promotion purchase condition model.

    Once you understand the XML representation of a promotion;

    1. Find a similar promotion type from the default promotions.

    2. Create the new promotion.

    3. Retrieve the necessary XML from the database.

    4. Replace the node with your own condition or reward.

    5. Then manually create it in the database

    6. Test your custom promotion.

  3. Understand where the promotion is persisted and cached. Promotion data is mainly stored in the PX_Promotion table. In particular, the promotion's XML representation is saved in the XMLPARAM column in that table. To test a new promotion XML for the customization type, refer to custom promotion types.

  4. Update user inferface as needed. This step should be done once you have a promotion XML that represents your business logic. To customize the WebSphere Commerce Accelerator, so that it generates XML according to your requirements, refer to Add support for a custom promotion type as a guideline.

Related concepts