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

WebSphere Commerce Version 7.0.0.0Feature Pack 1Review the class that provides the default Promotion Type Selector window; you can edit this class in the original source file, lzx/commerce/promotion/restricted/propertiesViews/BasePromotionTypeTemplatePicker.lzx/proBasePromotionTypeTemplatePicker .

Introduced in Feature Pack 2Review the definition that provides the default Promotion Type Selector window; you can edit this definition in the original source file, PromotionTypeTemplatePicker.def. This file is stored in the LOBTools/WebContent/config/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:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > promotion > propertiesViews.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > promotion > propertiesViews.
  4. Open the properties view file for the Promotion Type Selector window:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1PromotionTypeTemplatePicker.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1Find the following line of code in this file:
    <class name="proPromotionTypeTemplatePicker" 
    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:
    <wcfPropertyValuesFilter displayName="${promotionResources.promotion_folder_OrderLevelPromotions.string}" 
    propertyName="promotionType" values="OrderLevelPercentDiscount, OrderLevelValueDiscount, OrderLevelFreeGift"/>
    Introduced in Feature Pack 2PromotionTypeTemplatePicker.def Introduced in Feature Pack 2Find the following line of code in this file:
    <BasePromotionTypeTemplatePicker definitionName="proPromotionTypeTemplatePicker" package="pro">
    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:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1PromotionTypeTemplatePicker.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Find the wcfPropertyValuesFilter line 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:

      <wcfPropertyValuesFilter displayName="${promotionResources.promotion_folder_FixedCostPromotions.string}" 
      propertyName="promotionType" values="OrderLevelFixedShippingDiscount, 
      ProductLevelFixedShippingDiscount, CategoryLevelFixedShippingDiscount, 
      ProductLevelPWPFixedCostDiscount"/>
    Introduced in Feature Pack 2PromotionTypeTemplatePicker.def Introduced in Feature Pack 2
    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, CategoryLevelFixedShippingDiscount, ProductLevelPWPFixedCostDiscount"/>
  6. Create a new folder containing your new promotion type:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1PromotionTypeTemplatePicker.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Add a wcfPropertyValuesFilter line 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 <wcfPropertyValuesFilter line would look like this:

      <wcfPropertyValuesFilter displayName="Custom promotions" propertyName="promotionType" values="ProductLevelPWPFixedCostDiscount"/>
    Introduced in Feature Pack 2PromotionTypeTemplatePicker.def Introduced in Feature Pack 2
    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.