Develop > Presentation layer > Customize promotions > Promotions customization: Management Center > Create a custom promotion type in the Management Center
Add 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 the 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 class that provides the default Promotion Type Selector window; you can edit this class in the original source file:proPromotionTypeTemplatePicker
Procedure
- Plan where to add the 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 the new promotion type should go, or whether you need a new folder.
- Open WebSphere Commerce Developer.
- In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > promotion > propertiesViews.
- Open the properties view for the Promotion Type Selector window:
PromotionTypeTemplatePicker.lzx
- Find the following line of code in the 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"/>
- Do one or both of the following
- To add the new promotion type to an existing folder:
- Find the <wcfPropertyValuesFilter line for the existing folder.
- For the values attribute, add the identifier that represents the custom promotion type.
The identifier is the templateType value that you specified in the object template for the 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"/>
- To create a new folder containing the new promotion type:
- Add a <wcfPropertyValuesFilter line to create the new folder.
- For the values attribute, specify the identifier that represents the custom promotion type.
The identifier is the templateType value that you specified in the object template for the 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"/>
- Save and close the file.
Previous topic: Specify widgets for the promotion type properties view
Next topic: Register a serialization JSP file for the new object definition