Retrieving the runtime XML for a Promotion type

You can retrieve the runtime XML for any active promotion in your store from your database. If you are creating a custom promotion type, you can use the runtime XML from an existing promotion type as a model for designing the XML for your new type.

About this task

Runtime promotion XML samples can provide you with a starting point for creating custom promotion types for your store. Use the runtime promotion XML for a promotion type similar to the custom promotion type you are creating. You can retrieve the runtime promotion XML for an existing promotion from your database. The runtime promotion XML is stored in XMLPARAM column of the PX_PROMOTION database table. Ensure that you choose a promotion that is already activated. Until a promotion created in Management Center is activated, only placeholder XML is stored in the XMLPARAM column; this placeholder XML displays as PurchaseCondition impl="".

To extract the runtime XML for a default promotion type, complete the following steps:


  1. Open the Promotions tool.
  2. Create a promotion that is based on an existing promotion type. Select a promotion type that is similar to the custom promotion type you want to create.
    For more information about creating a promotion, see Creating promotions
  3. Activate the new promotion. Activating the promotion generates the runtime XML for this promotion. For more information about activating a promotion, see Activating or deactivating promotions
  4. From the explorer view, click the Promotions directory. The list of available promotions displays in the main work area. In the Promotions list view table, configure the columns to display the Unique ID column. Record the unique ID for the promotion you created.
    For more information about displaying hidden columns, see Using table views
  5. Open a database connection.
  6. Run the following query to retrieve the runtime XML for your promotion:
    Select XMLPARAM from PX_PROMOTION where PX_PROMOTION_ID=yourPromotionUniqueId

    Where yourPromotionUniqueId is the ID you recorded in step 3. The result from your query returns the runtime XML for your promotion. For example, the following code sample is the runtime XML for a promotion that offers a free gift with orders over $2000:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- This promotion does the following: Purchase over $2000 USD, receive free gift. -->
    <Promotion impl="">
      <!-- this identifies the promotion -->
        <-- Name of the promotion -->
        <PromotionName>Free gift with selected orders</PromotionName>
        <!-- The store that owns this promotion. Store key is defined as the combination of the 
             DN of the organization that owns this store and a store name --> 
          <DN>ou=elite,o=seller organization,o=root organization</DN>
        <!-- Versions of a promotion. Statistics are associated with the
             version number,promotions with the same promotion key and version 
             number but different revision are considered different revisions of
             the same promotion.  Promotions with the same key but different 
             version numbers are considered distinct promotions. -->
      <!-- Promotions are group by groups, and groups are scoped by store, 
           refer to promotion organization for details on what a group is, its role 
           and the default groups -->
          <DN>ou=elite,o=seller organization,o=root organization</DN>
      <!-- Various descriptions of the promotion -->
      <TypedNLDescription impl="">
        <Description locale="en_US" type="admin">Order Discount - Free Gift with orders over $2000 USD</Description>
        <Description locale="en_US" type="long">Spend over $2000 USD and get a free passenger vehicle battery.</Description>
        <Description locale="en_US" type="short">Spend over $2000 USD and get a free gift!</Description>
      <!-- Priority of the promotion the higher the more important
      <-- Exclusiveness of the promotion. Possible values are:  
          0: not exclusive at all 
          1: exclusive at the group level 
          2: exclusive at a global level 
          3: a backward compatibility mode that mimics the combinability 
             of order level promotions with product level promotions in 
             previous releases 
          4: This promotion can be stacked on top of other promotions in the same promotion group
      <!-- For future use, always empty for now -->
      <!-- For future use, always empty for now -->
      <!-- Status of the promotion: 
           0: inactive
           1: active
           2: deleted
           3: suspended 
           4: obsolete
      <!-- Audit trail, last update time and last person who updated the promotion -->
      <LastUpdate>18-06-2011 15:53:46</LastUpdate>
      <!-- How many times this promotion can be applied to the current order, 
           possible values are:  
           -1:              unlimited
           positive number: the limit 
      <!--How many times this promotion can be applied to a shopper, 
          possible values are:  
          -1:              unlimited,
          positive number: the limit 
          This value is only valid for a registered shopper, for none registered 
          shoppers there is no way to control how many times a shopper can redeem a 
      <!-- How many times this promotion can be redeemed overall.
           Possible values are:
           -1:              unlimited,
           positive number: the limit 
      <!-- Schedule information of this promotion -->
      <Schedule impl="">
        <DateRange impl="">
          <Start inclusive="true">01-01-2004 12:00:00</Start>
          <End inclusive="true">31-12-9999 12:00:00</End>
        <TimeWithinADay impl="">
          <Start inclusive="true">00:00:00</Start>
          <End inclusive="true">23:59:59</End>
        <Week impl="">
      <!-- Type of promotion:
          0: targeted
          1: private, that is, a coupon promotion 
      <!-- Whether a code is required to redeem this promotion. -->
      <!-- When a promotion code is entered, should the target condition be checked -->
      <!-- Check the target condition or not -->
      <!-- Do not change this element -->
      <PromotionCodeCondition impl=""/>
      <!-- Targeting condition --> 
      <Targeting impl="">
      <!-- Custom condition for the promotion can be added here -->
      <!-- This is core of a promotion definition -->
      <PurchaseCondition impl="">
        <!-- Matches the pattern targeted by the current promotion: the following 
             pattern matches the entire order, for details refer to the promotion 
             purchase condition model document 
        <Pattern impl="">
          <!-- A pattern is made up of multiple constraint, each specifying a 
               list of items that make up part of the pattern. There must be no 
               cross-sections between constraints 
          <Constraint impl="">
            <!-- Quantity requirement of this constraint -->
            <WeightedRange impl="">
              <!-- minimum number of item is 1 -->
              <!--  Maximum number of item is not limited  -->
              <-- Match as many as items that satisfy the criteria defined in the filter chain next
            <!-- Selection criteria -->    
            <FilterChain impl="">
              <!-- Multiple filters can be specified, the are applied in a contiguous fashion, 
                   that is, connected using a logical "and". The dummy filter returns anything 
                   passed to it, it effectively selects anything 
              <Filter impl=""/>
            <!-- The combination of the quantity requirement and the filter chain would return 
                 everything present in the shopcart as one big matched pattern 
        <!-- Once pattern is matched, rewards are assigned, for details refer to the 
             purchase condition model document 
        <Distribution impl="">
          <!-- A volume based distribution on the spending total is performed, 
               spending total is measure in USD -->
          <!-- First range 2000 <= spending -->
          <Range impl="">
                <!-- This reward, if the spending total of ALL matched patterns falls into the range of over 2000 -->
              <Reward impl="">
                <AdjustmentFunction impl="">
                  <!--  Reward can be associated with a sub set of the items that make up the pattern,
                        the input of this filter chain will be one matched pattern, and a sub set of 
                        items that make up that pattern is returned and adjustments are associated with 
                        the returned items also known as affected items
                  <FilterChain impl="">
                    <Filter impl=""/>
                  <!--  the adjustment  -->
                  <Adjustment impl="">
                    <RewardSpecification impl="">
                      <GiftItem impl=""> 
                          <DN>ou=elite,o=seller organization,o=root organization</DN>
                    <RewardChoice impl="">
                      <GiftItem impl="">
                          <DN>ou=elite,o=seller organization,o=root organization</DN>
                    <!-- This adjustment is applied to the entire order, 
                         possible values are: (case insentitive)
                         wholeOrder:  The entire order, that is, $15 dollars off 
                                      an entire order
                         AllAffectedItems: Affected items returned by the filter 
                                       chain defined above, that is, $15  dollars 
                                       off all of the affected items as a whole.
                         IndividualAffectedItems: Adjustments are applied to 
                                       affected items individually, that is, $15 
                                       dollars off each and every affected item.
          <PatternFilter impl=""/>
  7. Copy the data from your result and paste it in a document. Save this document as an XML document. You can preview this document in a Web browser for readability.