From 71716bb8f1b26967f34bcafc283a1d32f27e9cac Mon Sep 17 00:00:00 2001 From: anastas10s-afk <73900974+anastas10s-afk@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:53:14 +0200 Subject: [PATCH] Free shipping handling of minimum order rule Changes when coupons added and prices are entered and displayed inclusive of tax --- .../free-shipping/class-wc-shipping-free-shipping.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce/includes/shipping/free-shipping/class-wc-shipping-free-shipping.php b/plugins/woocommerce/includes/shipping/free-shipping/class-wc-shipping-free-shipping.php index 00d813f6d24..63758f48857 100644 --- a/plugins/woocommerce/includes/shipping/free-shipping/class-wc-shipping-free-shipping.php +++ b/plugins/woocommerce/includes/shipping/free-shipping/class-wc-shipping-free-shipping.php @@ -153,12 +153,11 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method { if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ), true ) ) { $total = WC()->cart->get_displayed_subtotal(); - if ( WC()->cart->display_prices_including_tax() ) { - $total = $total - WC()->cart->get_discount_tax(); - } - if ( 'no' === $this->ignore_discounts ) { $total = $total - WC()->cart->get_discount_total(); + if ( WC()->cart->display_prices_including_tax() ) { + $total = $total - WC()->cart->get_discount_tax(); + } } $total = NumberUtil::round( $total, wc_get_price_decimals() );