Skip to content

Commit 9da9520

Browse files
authored
gw-coupons-exclude-products.php: Fixed an issue with discount not applied correctly in some scenarios.
1 parent 505c724 commit 9da9520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gravity-forms/gw-coupons-exclude-products.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function modify_coupon_discount_amount( $discount, $coupon, $price ) {
193193
if ( $this->_args['exclude_options_from_fields'] ) {
194194
if ( $coupon['type'] == 'percentage' && ! ( $amount == 100 && $this->_args['skip_for_100_percent'] ) ) {
195195
$discount = $discount - ( $price * ( $amount / 100 ) );
196-
} else {
196+
} elseif ( $this->excluded_total < $discount) {
197197
$discount = $this->excluded_total;
198198
}
199199
} elseif ( $coupon['type'] == 'percentage' && ! ( $amount == 100 && $this->_args['skip_for_100_percent'] ) ) {

0 commit comments

Comments
 (0)