Promotions templates are XML files that are named with a .pmdt
extension. You must store templates in a root location specified in the configurationRootPath
property of the /atg/commerce/promotion/template/registry/PromotionTemplateRegistry
component. The default setting is:
configurationRootPath=/atg/registry/data/promotiontemplates
You can set this path to any valid value and construct any additional folder structure needed below it as you add templates. Templates are referenced by both name and location, therefore the names do not have to be unique, but it is good practice to give them unique names.
Template files are created manually. You can shorten the process by creating a PMDL rule in the Advanced Condition and Offer Editor, then retrieving the generated PMDL from the DCS_DISCOUNT_PROMO
table or from the asset detail page of the project. That PMDL can be used for the template’s pmdlrule
repository property, replacing placeholder names with the necessary values. You must still ensure that your template XML file includes the requisite user interface elements.
Note that if you do use this method to create a PMDL rule, you should be careful to delete the promotion you created, to avoiding confusing your users. You cannot delete promotions through Oracle ATG Web Commerce Merchandising the way you can some other assets, but you can create a temporary project in Merchandising, then delete the project without deploying.
What Promotion Templates Do
Templates allow your users to set promotion repository item properties through a simple interface. The pmdlRule
property one of the most important properties, but other properties such as usage dates can also be set this way (see Promotion Repository Item Properties for a full property list).
The
ui-description
section of the template lays out the visual elements of the template, which determine how it appears on the user’s screen. Much of theui-description
relies on standard form elements such astextInput
.The user interface also includes product set criteria (PSCs), which are sets of combination boxes that allow users to specify products to include in or exclude from a promotion. Modeling for these expressions is handled by a custom
PSCExpressionModel
component, which requires no configuration.See Creating the PMDT File for information on
ui-description
elements.The end-user provides their input to the template in Oracle ATG Web Commerce Merchandising. For example, the user might select products to include in the promotion, set begin and end dates for the promotion, and specify how many times the promotion can be given to a customer.
The template associates the user input with the
id
attribute of the element through which it was selected. For example, you could have atextInput
that allows the user to specify how many items can have the promotion applied:<textInput id="numberOfItemsToDiscount_textInput">
In the
textInput
example, the information referenced by theid
is most likely a simple integer; in the case of PSCs, theid
references a complex string of PMDL representing the user’s selections, their AND or OR conditions, etc.Translator elements in the template perform any transformations necessary to the user input; the translated input is assigned to a placeholder. For example, you may need to change date formatting or capitalization. For PSCs, the translators add required tags to create well-formed PMDL, which can then be processed by the back-end systems. See Translating User Input Values in Templates.
The
item-properties
section of the template provides the blueprint for the promotion, and defines what property information the promotion stores.