For a custom promotion type, you must identify to the promotion
service which XSLT templates to use to transform the authoring promotion
XML to the runtime promotion XML. You must also identify which attributes
the custom promotion type has. To do this, you register the custom
XSLT template that you created and other attributes for the new promotion
type in a new promotion type configuration file.
Procedure
Go to the following directory:
WC_eardir/xml/config
Create a com.ibm.commerce.promotion-ext directory.
Create a promotion type configuration file named com.ibm.commerce.promotion.facade.server.config.PromotionComponentConfigurationImpl.xml.
Register the custom XSLT template and other attributes
for the new promotion type in the new promotion type configuration
file.
The default promotion types are registered in
promotion type configuration file at this path:
The following example
is a custom promotion type configuration file. Differences from the
previous example are indicated in bold text. Here, the promotion type
configuration file indicates that a new "MyOrderLevelPercentDiscount"
promotion type uses the "MyOrderLevelPercentDiscountPurchaseConditionTemplate.xsl"
template to transform for purchase conditions; other promotion elements,
for example, the <CustomConditions> and <TargetingCondition>
elements, use the default templates.
The last two parameters
serve the following purposes:
promotionGroup: This parameter references
the promotion group that the promotion type belongs to, that is, order-level,
product-level, or shipping
calculationCodeDisplayLevel: This parameter
defines what customers see on the storefront regarding the promotion
price adjustment. The value 0 (order item display level) means a customer
sees the adjustment that is broken down for each individual item in
their order. The value 1 (order display level) means the customer
sees the adjustment for the whole order in a summary.
Example
For your custom promotion type, the full custom promotion
type configuration file looks like the following example:
What to do next
After you complete your customization:
Right-click LOBTools Project;
then click Build OpenLaszlo Project to produce
an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent
directory. This setting is the default environment setting.
Test your changes by viewing
them in the Management Center, using this URL: https://hostname:8000/lobtools.