From 137396fd9ebdbea582201f528567325c836a7c26 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 6 Dec 2011 10:49:26 +0000 Subject: [PATCH] Tax based on shipping address, and fixed outside_base function --- classes/customer.class.php | 3 ++- classes/tax.class.php | 8 ++++---- readme.txt | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/customer.class.php b/classes/customer.class.php index d8b50d8610e..86e083c4eb1 100644 --- a/classes/customer.class.php +++ b/classes/customer.class.php @@ -53,7 +53,8 @@ class woocommerce_customer { $state = ''; endif; - if ($country!==$_SESSION['customer']['country']) return true; + if ($country!==$_SESSION['customer']['shipping_country']) return true; + if ($state && $state!==$_SESSION['customer']['shipping_state']) return true; endif; return false; diff --git a/classes/tax.class.php b/classes/tax.class.php index dcd6ac98403..ea40a49e86a 100644 --- a/classes/tax.class.php +++ b/classes/tax.class.php @@ -117,8 +117,8 @@ class woocommerce_tax { /* Checkout uses customer location, otherwise use store base rate */ if ( defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT ) : - $country = $woocommerce->customer->get_country(); - $state = $woocommerce->customer->get_state(); + $country = $woocommerce->customer->get_shipping_country(); + $state = $woocommerce->customer->get_shipping_state(); $rate = $this->find_rate( $country, $state, $tax_class ); @@ -160,8 +160,8 @@ class woocommerce_tax { global $woocommerce; if (defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT) : - $country = $woocommerce->customer->get_country(); - $state = $woocommerce->customer->get_state(); + $country = $woocommerce->customer->get_shipping_country(); + $state = $woocommerce->customer->get_shipping_state(); else : $country = $woocommerce->countries->get_base_country(); $state = $woocommerce->countries->get_base_state(); diff --git a/readme.txt b/readme.txt index 34eaf8e1f85..69afcd8e1f2 100644 --- a/readme.txt +++ b/readme.txt @@ -94,6 +94,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo * Customer note field quote fix * Moved product-category and tag slugs to settings (page) * % coupon fix +* Tax rates based on shipping address = 1.3 - 01/12/2011 = * Minor bug fixes + localisations