From 33706cc1fb15e6aa5f6e57dbfb3d50bcf278d3d4 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 29 Nov 2011 00:20:51 +0000 Subject: [PATCH] Find tax rate fix --- classes/tax.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/tax.class.php b/classes/tax.class.php index f0682ff081f..dcd6ac98403 100644 --- a/classes/tax.class.php +++ b/classes/tax.class.php @@ -78,6 +78,8 @@ class woocommerce_tax { function find_rate( $country, $state = '*', $tax_class = '' ) { $rate['rate'] = 0; + + $tax_class = sanitize_title($tax_class); if (isset($this->rates[ $country ][ $state ])) : if ($tax_class) : @@ -190,9 +192,9 @@ class woocommerce_tax { // Loop cart and find the highest tax band if (sizeof($woocommerce->cart->get_cart())>0) : foreach ($woocommerce->cart->get_cart() as $item) : - if ($item['data']->tax_class) : + if ($item['data']->get_tax_class()) : - $found_rate = $this->find_rate( $country, $state, $item['data']->tax_class ); + $found_rate = $this->find_rate( $country, $state, $item['data']->get_tax_class() ); $found_rates[] = $found_rate['rate'];