Fix for free shipping handling of minimum order rule (#39155)
Fixes the calculation from when Apply minimum order rule before coupon discount is active and prices are entered inclusive of tax and displayed that way in cart and checkout, free shipping is no longer available (based on the minimum order amount including tax), as it uses the pre-tax amount when a coupon is applied. Fixes #28752
This commit is contained in:
commit
00073c0d4c
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Ensure that the full discount is ignored in free shipping minimum order calculations when ignore_discount setting is enabled
|
|
@ -162,12 +162,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() );
|
||||
|
|
Loading…
Reference in New Issue