Home Communication board WiKi Get Quote

X-Cart problem with the discount coupons

In some of the cases the coupon discount is bigger then it's presupposed by the coupon settings. It's pretty old X-Cart bug, but it still exists.

This problem is raised by the following code in the include/func/func.cart.php:

if ($discount_coupon_data["coupon_type"]=="absolute" && $discount_coupon_data['discount'] > $total) {
    $discount_coupon_data['discount'] = 100;
    $discount_coupon_data['coupon_type'] = 'percent';
}

Generally, this part of the code changed the coupon type from the absolute to the 100%, when the “total” is less then the coupon discount.

You should notice that the $total is cart “subtotal” here. So if the coupon discount is bigger than the subtotal, but less then the subtotal+tax, the discount will be applied to the whole sum: subtotal + tax.

To fix the issue you should simply comment the code above. In any case the cart total will not negative.

 
Home About us Privacy statement Terms & Conditions Refund policy © 2007–2024 ArsCommunity