Post by Johnathan » Thu Jan 09, 2014 2:24 am

Coupons in OpenCart just use the product sub-total when calculating percentage discounts, not the total at the position of the "Coupon" Order Total in the list. To make it factor in other Order Totals (such as fees or discounts) make this edit:

Code: Select all


$total_data[] = array(

if ($coupon_info['type'] == 'F') {
    $discount_total = $coupon_info['discount'];
} else {
    $discount_total = $total / 100 * $coupon_info['discount'];
Note that this will only work if the coupon is not applied to specific products (and will also make percentage coupons not work with specific products). Thanks to Dustin from for assistance in determining the correct code.

Image Image Image Image Image Image

User avatar
Global Moderator


Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 1 guest