From e677340fcc7c561457f5b5a496ee494718775172 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 1 May 2018 11:56:39 +0100 Subject: [PATCH] No need to load tax rates when taxes are disabled --- includes/class-wc-cart-totals.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index d56cb5fe456..bb2c384a113 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -481,6 +481,9 @@ final class WC_Cart_Totals { * @return array of taxes */ protected function get_item_tax_rates( $item ) { + if ( ! wc_tax_enabled() ) { + return array(); + } $tax_class = $item->product->get_tax_class(); return isset( $this->item_tax_rates[ $tax_class ] ) ? $this->item_tax_rates[ $tax_class ] : $this->item_tax_rates[ $tax_class ] = WC_Tax::get_rates( $item->product->get_tax_class(), $this->cart->get_customer() ); }