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

Review the following topics to ensure that you understand how a promotion is represented in XML:

About this task

To model the runtime promotion XML for your custom promotion type, start with the runtime promotion XML generated for a similar promotion type. Then, analyze the XML to determine how your custom promotion type is different and make any necessary changes to the XML.

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

  1. 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
  2. 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.

  3. 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

You want to model the runtime promotion XML for your custom promotion type that is based on the runtime promotion XML for the following promotion.
  • Buy catalog entry X, get a percentage off catalog entry Y
Based on this existing promotion type, you want to create the following custom promotion type promotion:
  • Customers who purchase two dining chairs (FULO-01) qualify to purchase a dining table (FULO-02) at the reduced price of $200
To model this XML, you must define only the contents of the <PurchaseCondition> element for your promotion type. All other elements of the promotion type remain the same as the default promotion that is being used as a starting point.

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>