diff --git a/includes/class-wc-discounts.php b/includes/class-wc-discounts.php index fea4eead963..c4e931f6d7f 100644 --- a/includes/class-wc-discounts.php +++ b/includes/class-wc-discounts.php @@ -664,6 +664,11 @@ class WC_Discounts { */ protected function validate_coupon_minimum_amount( $coupon ) { $subtotal = wc_remove_number_precision( $this->get_object_subtotal() ); + + if ( $this->object->get_prices_include_tax() ) { + $subtotal += round( $this->object->get_total_tax(), wc_get_price_decimals() ); + } + if ( $coupon->get_minimum_amount() > 0 && apply_filters( 'woocommerce_coupon_validate_minimum_amount', $coupon->get_minimum_amount() > $subtotal, $coupon, $subtotal ) ) { /* translators: %s: coupon minimum amount */ throw new Exception( sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $coupon->get_minimum_amount() ) ), 108 );