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
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
- Open HCL Commerce Developer and switch to the Enterprise Explorer view.
-
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
-
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.
-
Define the new property group.
See the example at the end of this procedure.
- 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>