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
-
Plan where to add your new promotion type in the Promotion Type Selector window:
- Open the Promotions tool.
- From the toolbar, click New.
- 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.
- Open WebSphere Commerce Developer.
-
Complete one of the following steps:
- In the Enterprise Explorer view, expand .
-
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"/>
-
Add your new promotion type to an existing folder:
In the PromotionTypeTemplatePicker.xml file:
- Find the
PropertyValuesFilter
element for the existing folder. - 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"/>
- Find the
-
Create a new folder containing your new promotion type.
In the PromotionTypeTemplatePicker.xml file:
- Add a
PropertyValuesFilter
element to create the new folder. - 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 newPropertyValuesFilter
element would look like this:<PropertyValuesFilter displayName="Custom promotions" propertyName="promotionType" values="ProductLevelPWPFixedCostDiscount"/>
- Add a
- Save and close the file.