Modeling the runtime promotion XML
You can model the runtime promotion XML for your new promotion type to identify the data that must be managed for your custom promotion type. The data you identity as required information is used in subsequent promotion customization tasks to help create your promotion type.
Before you begin
About this task
Most customized promotion types focus on customizing the <PurchaseCondition> element. The purchase condition defines what customers must have in their shopping cart before they qualify for a promotion, as well as the reward. Business users enter data for a specific promotion in the Purchase Condition and Reward section of the user interface.
Procedure
- Examine the runtime promotion XML for a similar promotion type to use as a starting point for your model. For more information about retrieving the runtime XML for a promotion, see Retrieving the runtime XML for a Promotion type
-
Change the retrieved runtime promotion XML to reflects the requirements for your custom
promotion type.
If you are customizing the purchase condition or reward, focus on the <PurchaseCondition> element, specifically the <Pattern> element for the purchase condition and the <Distribution> element for the promotion reward.
In some cases, it makes sense to look at more than one default promotion type to get the result you want. Your custom promotion type might combine a purchase condition from one default promotion type with a reward from a different default promotion type.
- Give this promotion structure a unique promotion type name, for example, ProductLevelPWPFixedCostDiscount. You must refer to this name when you create the custom promotion type.
Example
- Buy catalog entry X, get a percentage off catalog entry Y
- Customers who purchase two dining chairs (FULO-01) qualify to purchase a dining table (FULO-02) at the reduced price of $200
Your model of the <PurchaseCondition> element in the runtime promotion XML looks like the following sample:
<PurchaseCondition impl="com.ibm.commerce.marketing.promotion.condition.PurchaseCondition">
<Pattern impl="com.ibm.commerce.marketing.promotion.condition.Pattern">
<Constraint impl="com.ibm.commerce.marketing.promotion.condition.Constraint">
<WeightedRange impl="com.ibm.commerce.marketing.promotion.condition.WeightedRange">
<LowerBound>2</LowerBound>
<UpperBound>2</UpperBound>
<Weight>1</Weight>
</WeightedRange>
<FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain">
<Filter impl="com.ibm.commerce.marketing.promotion.condition.MultiSKUFilter">
<IncludeCatEntryKey>
<CatalogEntryKey>
<SKU>FULO-01</SKU>
<DN>ou=b2c,o=seller organization,o=root organization</DN>
</CatalogEntryKey>
</IncludeCatEntryKey>
</Filter>
</FilterChain>
</Constraint>
<Constraint impl="com.ibm.commerce.marketing.promotion.condition.Constraint">
<WeightedRange impl="com.ibm.commerce.marketing.promotion.condition.WeightedRange">
<LowerBound>1</LowerBound>
<UpperBound>1</UpperBound>
<Weight>1</Weight>
</WeightedRange>
<FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain">
<Filter impl="com.ibm.commerce.marketing.promotion.condition.MultiSKUFilter">
<IncludeCatEntryKey>
<CatalogEntryKey>
<SKU>FULO-02</SKU>
<DN>ou=b2c,o=seller organization,o=root organization</DN>
</CatalogEntryKey>
</IncludeCatEntryKey>
</Filter>
</FilterChain>
</Constraint>
</Pattern>
<Distribution impl="com.ibm.commerce.marketing.promotion.reward.Distribution">
<Type>Volume</Type>
<Base>Quantity</Base>
<Currency>USD</Currency>
<Range impl="com.ibm.commerce.marketing.promotion.reward.DistributionRange">
<UpperBound>-1</UpperBound>
<LowerBound>1</LowerBound>
<UpperBoundIncluded>false</UpperBoundIncluded>
<LowerBoundIncluded>true</LowerBoundIncluded>
<RewardChoice>
<Reward impl="com.ibm.commerce.marketing.promotion.reward.DefaultReward">
<AdjustmentFunction impl="com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction">
<FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain">
<Filter impl="com.ibm.commerce.marketing.promotion.condition.MultiSKUFilter">
<IncludeCatEntryKey>
<CatalogEntryKey>
<SKU>FULO-02</SKU>
<DN>ou=b2c,o=seller organization,o=root organization</DN>
</CatalogEntryKey>
</IncludeCatEntryKey>
</Filter>
</FilterChain>
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedCostAdjustment">
<FixedCost>200</FixedCost >
<Currency>USD</Currency>
<AdjustmentType>IndividualAffectedItems</AdjustmentType>
</Adjustment>
</AdjustmentFunction>
</Reward>
</RewardChoice>
</Range>
<PatternFilter impl="com.ibm.commerce.marketing.promotion.condition.DummyPatternFilter" />
</Distribution>
</PurchaseCondition>