Creating the object template
In this lesson, you create an object template to define the object structure
for the promotion. The object template contains all the objects that each promotion type requires.
There is one object template for each promotion type defined in the Promotions tool to specify the
unique properties of the promotion type.
About this task
- Whether the promotion is an order-level, catalog-entry-level or category-level promotion
- Whether the discount is a fixed price, a percentage off, an amount off, or a free gift
The object template you are adding, extProductLevelFreeGiftTemplate, is a product level promotion, with a free gift reward.
Procedure
-
Create a new folder for your template:
- In the Enterprise Explorer view, expand
- Right-click the objectDefinitions folder; then click .
- In the Folder name field, type promotionTypes.
- Click Finish.
-
Create a new file for the promotion template:
-
Copy and paste the following code into this definition file:
Notice the <object> elements defined in the template; the objectType value will be stored in the SUBTYPE column of the PX_ELEMENT table.<Definitions> <!--Object template for extended promotion type ProductLevelFreeGift. --> <ObjectTemplate definitionName="cmc/promotion/ExtProductLevelFreeGiftTemplate" description="${ExtPromotionResources.promotion_type_description_ProductLevelFreeGift}" displayName="${ExtPromotionResources.promotion_type_ProductLevelFreeGift}" templateType="ProductLevelFreeGift"> <dependency localName="ExtPromotionResources" moduleName="cmc/promotion/ExtPromotionResources"/> <Xml name="template"> <object objectType="ProductLevelFreeGiftPurchaseCondition"/> </Xml> </ObjectTemplate> </Definitions>
- Save and close the file.
-
Add your new template to the promotion primary object definition.