From 8b1bcda6da35a129f66b975909c7a3ebb3ed219f Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Fri, 22 Nov 2024 12:43:30 -0500 Subject: [PATCH] Ensure that tax is enabled before determining how it is calculated (#9786) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: César Costa <10233985+cesarcosta99@users.noreply.github.com> --- changelog/as-fix-ece-tax-based-billing-address | 4 ++++ .../class-wc-payments-express-checkout-button-helper.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog/as-fix-ece-tax-based-billing-address diff --git a/changelog/as-fix-ece-tax-based-billing-address b/changelog/as-fix-ece-tax-based-billing-address new file mode 100644 index 00000000000..ab6fc7be8fd --- /dev/null +++ b/changelog/as-fix-ece-tax-based-billing-address @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Ensure ECE is displayed correctly taking into account the tax settings. \ No newline at end of file diff --git a/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php b/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php index 76ad18c7ec4..4c33d60cd2b 100644 --- a/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php +++ b/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php @@ -427,7 +427,7 @@ public function should_show_express_checkout_button() { ) // ...and billing is calculated based on billing address. - && 'billing' === get_option( 'woocommerce_tax_based_on' ) + && wc_tax_enabled() && 'billing' === get_option( 'woocommerce_tax_based_on' ) ) { return false; }