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:
parent
38822cb3e9
commit
71716bb8f1
|
@ -153,12 +153,11 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
|
||||||
if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ), true ) ) {
|
if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ), true ) ) {
|
||||||
$total = WC()->cart->get_displayed_subtotal();
|
$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 ) {
|
if ( 'no' === $this->ignore_discounts ) {
|
||||||
$total = $total - WC()->cart->get_discount_total();
|
$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() );
|
$total = NumberUtil::round( $total, wc_get_price_decimals() );
|
||||||
|
|
Loading…
Reference in New Issue