Adding the new promotion type to the Promotion Type Selector window

In this lesson, you add your new promotion type to the Free gift promotions folder in the Promotion Type Selector window so business users can select the template when starting a new promotion.

Procedure

  1. Open WebSphere Commerce Developer.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, navigate to the LOBTools > WebContent > WEB-INF > src > lzx > commerce > promotion > propertiesViews directory.
    • Introduced in Feature Pack 3Feature Pack 2In the Enterprise Explorer view, navigate to the LOBTools > WebContent > config > commerce > promotion > propertiesViews directory.
  3. Open the properties view file for the Promotion Type Selector window:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1PromotionTypeTemplatePicker.lzx
    • Introduced in Feature Pack 3Feature Pack 2PromotionTypeTemplatePicker.def
  4. Add your custom promotion type to the Free gift promotions folder:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1PromotionTypeTemplatePicker.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1In this properties view class file:
    1. Find the following line of code in the file:
      <wcfPropertyValuesFilter displayName="${promotionResources.promotion_folder_FreeGiftPromotions.string}" 
      propertyName="promotionType" values="OrderLevelFreeGift, ProductLevelBuyXGetYFree, CategoryLevelBuyXGetYFree"/>
    2. Add the object template name for your custom promotion type (ProductLevelFreeGift) to the list of values, as shown here:
      <wcfPropertyValuesFilter displayName="${promotionResources.promotion_folder_FreeGiftPromotions.string}" 
      propertyName="promotionType" values="OrderLevelFreeGift, ProductLevelBuyXGetYFree, CategoryLevelBuyXGetYFree, ProductLevelFreeGift"/>
    3. Save and close the file.
    4. Right-click the LOBTools project; then click Build OpenLaszlo Project on the context menu.
    Introduced in Feature Pack 3Feature Pack 2PromotionTypeTemplatePicker.def Introduced in Feature Pack 3Feature Pack 2In this properties view definition file:
    1. Find the following line of code in the file:
      <PropertyValuesFilter displayName="${promotionResources.promotion_folder_FreeGiftPromotions}" propertyName="promotionType" values="OrderLevelFreeGift, ProductLevelBuyXGetYFree, CategoryLevelBuyXGetYFree"/>
    2. Add the object template name for your custom promotion type (ProductLevelFreeGift) to the list of values, as shown here:
      <PropertyValuesFilter displayName="${promotionResources.promotion_folder_FreeGiftPromotions}" 
      propertyName="promotionType" values="OrderLevelFreeGift, ProductLevelBuyXGetYFree, CategoryLevelBuyXGetYFree, ProductLevelFreeGift"/>
    3. Save and close the file.

Results

In this lesson, you added your custom promotion type to a folder in the Promotion Type Selector window. In the next lesson, you register a new serialization JSP file to convert the promotion authoring elements from the PX_ELEMENT and PX_ELEMENTNVP tables into the Management Center user interface for the Purchase Condition and Reward section.