Free shipping handling of minimum order rule

Changes when coupons added and prices are entered and displayed inclusive of tax
This commit is contained in:
anastas10s-afk 2023-06-25 23:53:14 +02:00
parent 38822cb3e9
commit 71716bb8f1
1 changed files with 3 additions and 4 deletions

View File

@ -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() );