Specifying widgets for the promotion type properties view

Declare the widgets and child list editors for business users to enter data about the new promotion type. By doing this, you create the user interface, called the properties view, for the custom promotion type. The input widgets you need to collect information from business users have already been defined for use in the existing promotion types. When creating a new promotion type, you must specify which of these widgets you need, and then arrange and customize them as required to support your promotion type.

About this task

In the Management Center, each object definition has a different ObjectProperties definition that is used to edit the properties of that specific object type. In the Promotions tool, all promotions are represented by a single object type. This means that they all share the same ObjectProperties definition, that is, the properties view definition. Each promotion type then has its own unique property group to define the purchase condition and reward section of the properties view. The purchase condition and reward section is the only section of the properties view that is different from one promotion type to the next.

When a business user is creating a promotion, only the property groups for that specific promotion type are displayed in the Promotions tool user interface.

Procedure

  1. Open HCL Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a directory to store your new property group file.
    You can store the file in a directory structure similar to the following example:
    • LOBTools\WebContent\WEB-INF\src\xml\your_company_name\promotion\propertiesViews\promotionTypes
  3. Create a new file for the promotion element object definition. Use the following syntax to create this file: promotion_type_nameProperties.xml, for example, ProductLevelPWPFixedCostDiscountProperties.xml.
  4. Define the new property group.
    See the example at the end of this procedure.
  5. Add the new property group to the promotion properties view in the PromotionPropertiesView.xml file. This file is stored in the LOBTools\WebContent\WEB-INF\src\xml\commerce\promotion\propertiesViews directory.

Example

For your custom promotion type, Customers who purchase two dining chairs (FULO-01) qualify to purchase a dining table (FULO-02) at the reduced price of $200, the code for the property group to declare the property editor widgets and child list editors looks like this:

<PropertyGroup definitionName="proProductLevelPWPFixedCostDiscountProperties"
      collapsable="false">
   <EnablementCondition conditionId="promotionType" propertyName="promotionType"
         enablementValue="ProductLevelPWPFixedCostDiscount"/>
   <PropertyGroup name="purchaseConditionAndRewardGroup"
         groupTitle="purchaseConditionAndRewardTitle">
      <PropertyChildListEditor
            objectPath="ProductLevelPWPFixedCostDiscountPurchaseCondition/Purchase"
            objectTypes="Identifier_CatalogEntry,Identifier_InheritedCatalogEntry"
            name="purchaseCatalogEntry" listDefinitionName="proProductElementTypeGrid"
            required="true" promptText="Select_SKU_X" />
      <PropertyStepper
            objectPath="ProductLevelPWPFixedCostDiscountPurchaseCondition/Purchase"
            propertyName="Quantity" required="true" promptText="Quantity_of_X" />
      <PropertyChildListEditor
            objectPath="ProductLevelPWPFixedCostDiscountPurchaseCondition/Reward"
            objectTypes="Identifier_CatalogEntry" name="rewardCatalogEntry"
            listClass="proProductElementTypeGrid" required="true"
            promptText="Select_SKU_Y" />
      <PropertyStepper
            objectPath="ProductLevelPWPFixedCostDiscountPurchaseCondition/Reward"
            propertyName="Quantity" required="true" promptText="Quantity_of_Y" />
      <PropertyNumericText objectPath="ProductLevelPWPFixedCostDiscountPurchaseCondition"
            propertyName="FixedCost" required="true" promptText="Discount_on_Y" />
   </PropertyGroup>
</PropertyGroup>
In this example, the code to add the new property group to the promotion properties view looks like this:
<PropertyPane definitionName="cmc/promotion/PromotionManageTabPaneContent">
   .
   .
   . 	
   <PropertyGroup baseDefinitionName="proProductLevelPWPFixedCostDiscountProperties"/>
   .
   . 
</PropertyPane>