Adding the new promotion type to the Promotion Type Selector window

In the Promotions tool, business users select the promotion type to use from the Promotion Type Selector window. By default, your new promotion type automatically displays in the All promotions folder. To make your new promotion type easier for business users to find, you might want to add it to an existing folder, or create a new folder containing all custom promotion types.

Before you begin

Review the definition that provides the default Promotion Type Selector window; you can edit this definition in the original source file, PromotionTypeTemplatePicker.xml. This file is stored in the LOBTools\WebContent\WEB-INF\src\xml\commerce\promotion\propertiesViews directory.

Procedure

  1. Plan where to add your new promotion type in the Promotion Type Selector window:
    1. Open the Promotions tool.
    2. From the toolbar, click New.
    3. Examine the Promotion Type Selector window to determine the folder in which your new promotion type should go, or whether you need a new folder.
  2. Open WebSphere Commerce Developer.
  3. Complete one of the following steps:
    • In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > xml > commerce > promotion > propertiesViews.
  4. Open the properties view file for the Promotion Type Selector window, PromotionTypeTemplatePicker.xml.
    Find the following line of code in this file:
    <BasePromotionTypeTemplatePicker definitionName="cmc/promotion/PromotionTypeTemplatePicker" package="cmc/promotion">
    Below this line, each folder in the Promotion Type Selector window is defined. For example, the following line of code defines the existing folder labeled Order promotions and the three promotion types that the folder contains:
    <PropertyValuesFilter displayName="${promotionResources.promotion_folder_OrderLevelPromotions}" propertyName="promotionType" values="OrderLevelPercentDiscount, OrderLevelValueDiscount, OrderLevelFreeGift"/>
  5. Add your new promotion type to an existing folder:
    In the PromotionTypeTemplatePicker.xml file:
    1. Find the PropertyValuesFilter element for the existing folder.
    2. For the values attribute, add the identifier that represents your custom promotion type.

      The identifier is the templateType value that you specified in the object template for your new promotion type.

      For example, to add a new ProductLevelPWPFixedCostDiscount promotion type to the Fixed price promotions folder, add the string shown in bold in this example:

      
      <PropertyValuesFilter displayName="${promotionResources.promotion_folder_FixedCostPromotions}" propertyName="promotionType" values="OrderLevelFixedShippingDiscount, ProductLevelFixedShippingDiscount, ProductLevelFixedCostDiscount, ProductLevelPerItemFixedCostDiscount, ProductLevelPWPFixedCostDiscount, CategoryLevelFixedShippingDiscount, CategoryLevelFixedCostDiscount, CategoryLevelPerItemFixedCostDiscount"/>
      
  6. Create a new folder containing your new promotion type.
    In the PromotionTypeTemplatePicker.xml file:
    1. Add a PropertyValuesFilter element to create the new folder.
    2. For the values attribute, specify the identifier that represents your custom promotion type.

      The identifier is the templateType value that you specified in the object template for your new promotion type.

      For example, to add a new ProductLevelPWPFixedCostDiscount promotion type to a new Custom promotions folder, the new PropertyValuesFilter element would look like this:

      <PropertyValuesFilter displayName="Custom promotions" propertyName="promotionType" values="ProductLevelPWPFixedCostDiscount"/>
  7. Save and close the file.