Don't apply product discount if price is already 0

Closes #8725
This commit is contained in:
Mike Jolley 2015-08-05 13:45:28 +01:00
parent 2954707118
commit d222dd4c37
1 changed files with 12 additions and 10 deletions

View File

@ -634,6 +634,7 @@ class WC_Coupon {
// Handle the limit_usage_to_x_items option
if ( $this->is_type( array( 'percent_product', 'fixed_product' ) ) ) {
if ( $discounting_amount ) {
if ( '' === $this->limit_usage_to_x_items ) {
$limit_usage_qty = $cart_item_qty;
} else {
@ -646,6 +647,7 @@ class WC_Coupon {
$discount = ( $discount / $cart_item_qty ) * $limit_usage_qty;
}
}
}
$discount = round( $discount, WC_ROUNDING_PRECISION );