rebase on oct-10-2023
This commit is contained in:
@@ -36,6 +36,15 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
|
||||
*/
|
||||
public $requires = '';
|
||||
|
||||
/**
|
||||
* Ignore discounts.
|
||||
*
|
||||
* If set, free shipping would be available based on pre-discount order amount.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $ignore_discounts;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -153,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() );
|
||||
|
||||
Reference in New Issue
Block a user