This promotion discounts one or more items when a shopper spends the specified amount in the specified collections. Unlike the Spend Y Get Order Discount promotion, which looks only at the total amount spent on the order to determine whether the customer qualifies for the promotion, this promotion examines the individual items in the shopping cart.

The following example creates a promotion that discounts the product Beach Umbrella by 50% when the shopper spends $10 in the Summer Favorites collection, whose ID is cat60036.

{
  "displayName":"Spend $10 in Summer Favorites, get 50% off a beach umbrella",
  "description":"A sample spend y in x get item discount promotion",
  "priceListGroups":["defaultPriceGroup"],
  "enabled":true,
  "priority":"1",
  "startDate":"2016-03-10T00:00:00.000-05:00",
  "endDate":"2116-03-30T00:00:00.000-05:00",
  "templatePath": "item",
  "templateName": "rawPmdlTemplate",
  "templateValues":{"pmdl": { "xml": {"<pricing-model><qualifier><quantifier
    name="at-least" number="10"><collection-name>items</collection-name><element-
    name>item</element-name><aggregator name="spendAmount"
    operation="total"/><comparator name="includes-any">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type><string-
    value>cat60036</string-value></constant></comparator>
    </quantifier></qualifier><offer><discount-structure
    calculator-type="standard" discount-type="percentOff"
    adjuster="50"><target><iterator name="up-to-and-including" number="-1"
    sort-by="priceInfo.listPrice" sort-order="ascending">
    <collection-name>items</collection-name><element-name>item</element-name>
    <aggregator name="quantity" operation="total"/>
    <comparator name="includes-any">
    <value>item.auxiliaryData.productRef.ancestorCategoryIds</value>
    <constant><data-type>java.util.Set</data-type>
    <string-value>cat60036</string-value></constant></comparator>
    </iterator></target></discount-structure></offer></pricing-model>"}
}
}

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices