Home : OpenEdit SDK : Programming OpenEdit : ECommerce Setup : Quantity Discounts
Quantity Discounts
To setup a discount based on price you need to edit the product .xconf files and add the price structure. You can add quantity discounts at the item level or at the product level.
Example
/store/products/balloon.xconf
<page>
<product name="Balloon" id="balloon" ordering="-1" available="TRUE">
<item sku="balloon-1" inventory="1000">
<color/>
<size/>
<price quantity="1">1.00</price>
<price quantity="10">.50</price>
<price quantity="100">.25</price>
<property name="quickship">false</property>
</item>
<catalog id="household"/>
</product>
</page>
To demonstrate the behaviour, in this example the following costs would be applied:
-
2 balloons - Total cost is 2.00 (2 x 1.00)
-
12 balloons - Total cost is 6.00 (12 x 0.50)
-
102 balloons - Total cost is
We see that that this item has a price that goes as low as .25 cents per ballon. Once you order this product you can adjust the quantity. Or you can add your own quantity text field to the page:
<input name="quantity" value="1" type=text class=qty>
Example with default price breaks
If you wanted to apply default price breaks for all items of a product that don't have a price-break defined then place the <price> tags after the item tags as shown below:
<page>
<product name="Balloon" id="balloon" ordering="-1" available="TRUE">
<item sku="balloon-1" inventory="1000">
<color/>
<size/>
<property name="quickship">false</property>
</item>
<price quantity="1">1.00</price>
<price quantity="10">.50</price>
<price quantity="100">.25</price>
<catalog id="household"/>
</product>
</page>
