From b4b086ed3340e8c3f91a722f28d7c0d7ee15626c Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Mon, 12 May 2025 22:50:53 +0530 Subject: [PATCH] `gw-coupons-exclude-products.php`: Fixed an issue with discount not applied correctly in some scenarios. --- gravity-forms/gw-coupons-exclude-products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity-forms/gw-coupons-exclude-products.php b/gravity-forms/gw-coupons-exclude-products.php index 3a7769ed1..012b88660 100644 --- a/gravity-forms/gw-coupons-exclude-products.php +++ b/gravity-forms/gw-coupons-exclude-products.php @@ -193,7 +193,7 @@ function modify_coupon_discount_amount( $discount, $coupon, $price ) { if ( $this->_args['exclude_options_from_fields'] ) { if ( $coupon['type'] == 'percentage' && ! ( $amount == 100 && $this->_args['skip_for_100_percent'] ) ) { $discount = $discount - ( $price * ( $amount / 100 ) ); - } else { + } elseif ( $this->excluded_total < $discount) { $discount = $this->excluded_total; } } elseif ( $coupon['type'] == 'percentage' && ! ( $amount == 100 && $this->_args['skip_for_100_percent'] ) ) {