**O**ne of my previous blogs, http://paxcel.net/blog/promotions-coupons-creation-in-ofbiz-for-ecommerce-site, explains how to create coupons or promotions applicable on products. The current blog will help to create promotions or coupons on total order amount.

General steps to create promotions or coupons are same as mentioned in blog http://paxcel.net/blog/promotions-coupons-creation-in-ofbiz-for-ecommerce-sites/ . But creation of rules with conditions and actions is different.

**Coupons can be applied on :**

1. Total order amount

2. Product

3. Shipping charges

4. Tax charges (S.Tax , VAT etc)

**Some of the possibilities of coupons on total order amount are as follows :**

**1. Flat amount :**

a. If cart subtotal is greater than Rs”X” then order amount flat is Rs”Y”.

b. If cart subtotal is greater than Rs”X1″ and less than Rs”X2″ then order amount flat is Rs”Y”.

c. If cart subtotal is greater than equal to Rs”X1″ and less than Rs”X2″ then order amount flat is Rs”Y1″ or cart subtotal is greater than than equal to Rs”X3″ and less than Rs”X4″ then order amount flat is Rs”Y2″ or cart subtotal is greater than equal to Rs”X5″ and less than Rs”X6″ then order amount flat is Rs”Y3″.

**2. Percent Discount**

a. If cart subtotal is greater than Rs”X” then order percent discount is Rs”Y”.

b. If cart subtotal is greater than Rs”X1″ and less than Rs”X2″ then order percent discount is Rs”Y”.

c. If cart subtotal is greater than equal to Rs”X1″ and less than Rs”X2″ then order percent discount is Rs”Y1″ or cart subtotal is greater than equal to Rs”X3″ and less than Rs”X4″ then order percent discount is Rs”Y2″ or cart subtotal is greater than equal to Rs”X5″ and less than Rs”X6″ then order percent discount is Rs”Y3″.

**3. Gift with purchase**

a.If cart subtotal is greater than Rs”X” then get “Y” quantity of Product “A” free.

b. If cart subtotal is greater than Rs”X1″ and less than Rs”X2″ then get “Y” quantity of Product “A” free.

c. If cart subtotal is greater than equal to Rs”X1″ and less than Rs”X2″ then get “Y” quantity of Product “A” free 0r cart subtotal is greater than than equal to Rs”X3″ and less than Rs”X4″ then get “Y” quantity of Product “B” free or cart subtotal is greater than equal to Rs”X5″ and less than Rs”X6″ then get “Y” quantity of Product “C” free.

**4. Shipping total discount**

a. If cart subtotal is greater than Rs”X” then get shipping charges with Y% discount.

b. If cart subtotal is greater than Rs”X1″ and less than Rs”X2″ then get shipping charges with Y% discount.

c. If cart subtotal is greater than equal to Rs”X1″ and less than Rs”X2″ then get shipping charges with Y1% discount or cart subtotal is greater than equal to Rs”X3″ and less than Rs”X4″ then get shipping charges with Y2% discount or cart subtotal is greater than equal to Rs”X5″ and less than Rs”X6″ then get shipping charges with Y3% discount.

**5. Product Discount**

a. If cart subtotal is greater than Rs”X1″ and less than Rs”X2″ then get Product “A” with Y% discount.

**Following is a screenshot that shows creation of rules with conditions and actions**

**Rules with conditions and actions required to create are as follows :**

Coupon |
RuleName |
Conditions |
Actions |

1a | coupon1arule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition Value : X | Action 01:Dropdown :Order Amount FlatAmount : Y |

1b | coupon1brule1 | Condition 01 : Dropdown : cart sub-totalDropdown : is greater than or equal toCondition Value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition Value : X2 |
Action 01:Dropdown :Order Amount FlatAmount : Y |

1c | coupon1crule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:
Dropdown : Order Amount Flat Amount : Y1 |

coupon1crule2 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X3Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X4 |
Action 01:Dropdown : Order Amount FlatAmount : Y2 | |

coupon1crule3 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value: X5Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value: X6 |
Action 01:Dropdown : Order Amount FlatAmount : Y3 | |

2a | coupon2arule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X | Action 01:Dropdown : Order Percent DiscountAmount : Y |

2b | coupon2brule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:Dropdown : Order Percent DiscountAmount : Y |

2c | coupon2crule1 | Condition 01 :Dropdown : cart sub-totalDropdown: is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Conditon value :X2 |
Action 01:Dropdown : Order Percent DiscountAmount : Y1 |

coupon2crule2 | Condition 01 :Dropdown :cart sub-totalDropdown : is greater than or equal toCondition value : X3Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X4 |
Action 01:Dropdown : Order Percent DiscountAmount : Y2 | |

coupon2crule3 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X5Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value: X6 |
Action 01:Dropdown : Order Percent DiscountAmount : Y3 | |

3a | coupon3arule1 | Condition 01 :Dropdown: cart sub-totalDropdown : is greater than or equal toCondition value : X | Action 01:Dropdown : Gift with purchaseQuantity: YItemId : A |

3b | coupon3brule1 | Condition 01 :Dropdown : cart sub-totalDroprdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:Dropdown : Gift with purchaseQuantity: YItemId : A |

3c | coupon3crule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:Dropdown : Gift with purchaseQuantity: YItemId : A |

coupon3crule2 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X3Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X4 |
Action 01:Dropdown : Gift with purchaseQuantity: YItemId : B | |

coupon3crule3 | Condition 01 :Dropdown :cart sub-totalDropdown : is greater than or equal toCondition value : X5Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X6 |
Action 01:Dropdown : Gift with purchaseQuantity: YItemId : C | |

4a | coupon4arule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X | Action 01:Dropdown : Shipping X% DiscountAmount : Y |

4b | coupon4brule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:Dropdown : Shipping X% DiscountAmount : Y |

4c | coupon4crule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X2 |
Action 01:Dropdown : Shipping X% DiscountAmount : Y1 |

coupon4crule2 | Condition 01 :Dropdown : cart sub-totalDropdown: is greater than or equal toCondition value : X3Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X4 |
Action 01:Dropdown : Shipping X% DiscountAmount : Y2 | |

coupon4crule3 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value : X5Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value : X6 |
Action 01:Dropdown : Shipping X% DiscountAmount : Y3 | |

5a | coupon5arule1 | Condition 01 :Dropdown : cart sub-totalDropdown : is greater than or equal toCondition value: X1Condition 02:Dropdown : cart subtotal
Dropdown : is less than or equal to Condition value :X2 |
Action 01:Dropdown : X product for Y% dsicountAmount : YProductId : A |

Following these rules , coupons on total order amount can be created. More than one promotions or coupon can be applied on single order for a particular customer depending on requirement.

**References :**

1. Promotions : http://ofbiz.businessesnetwork.com/cmssite/cms/APACHE_OFBIZ_HTML#Promotions

2. Basic steps to create coupons : http://paxcel.net/blog/promotions-coupons-creation-in-ofbiz-for-ecommerce-site.

3. To create product promotions : https://cwiki.apache.org/OFBIZ/product-promotion-example.html