Fixes, tax class changes

This commit is contained in:
Mike Jolley 2011-10-07 23:24:11 +01:00
parent c439ec41e0
commit 05a1046968
6 changed files with 13 additions and 6 deletions

View File

@ -33,7 +33,7 @@ function woocommerce_update_options($options) {
for ($i=0; $i<sizeof($tax_classes); $i++) :
if (isset($tax_classes[$i]) && isset($tax_countries[$i]) && isset($tax_rate[$i]) && $tax_rate[$i] && is_numeric($tax_rate[$i])) :
if (isset($tax_classes[$i]) && isset($tax_countries[$i]) && isset($tax_rate[$i]) && is_numeric($tax_rate[$i])) :
$rate = number_format(woocommerce_clean($tax_rate[$i]), 4);
$class = woocommerce_clean($tax_classes[$i]);

View File

@ -343,7 +343,7 @@ class woocommerce_cart {
if ( $_product->is_taxable() ) :
$rate = $_tax->get_rate( $_product->tax_class );
$rate = $_tax->get_rate( $_product->get_tax_class() );
if (get_option('woocommerce_prices_include_tax')=='yes') :
@ -362,7 +362,7 @@ class woocommerce_cart {
*
* Lets get the base rate first
*/
$base_rate = $_tax->get_shop_base_rate( $_product->tax_class );
$base_rate = $_tax->get_shop_base_rate( $_product->get_tax_class() );
// Calc tax for base country
$base_tax_amount = $_tax->calc_tax( $_product->get_price(), $base_rate, true);

View File

@ -630,7 +630,7 @@ class woocommerce_checkout {
// Calc item tax to store
$rate = '';
if ( $_product->is_taxable()) :
$rate = $_tax->get_rate( $_product->tax_class );
$rate = $_tax->get_rate( $_product->get_tax_class() );
endif;
// Store any item meta data

View File

@ -461,13 +461,18 @@ class woocommerce_product {
return $price;
}
/** Returns the tax class */
function get_tax_class() {
return apply_filters('woocommerce_product_tax_class', $this->tax_class, $this);
}
/** Returns the base tax rate */
function get_tax_base_rate() {
if ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :
$_tax = &new woocommerce_tax();
$rate = $_tax->get_shop_base_rate( $this->tax_class );
$rate = $_tax->get_shop_base_rate( $this->get_tax_class() );
return $rate;

View File

@ -65,7 +65,7 @@ class flat_rate extends woocommerce_shipping_method {
if ( $_product->is_shipping_taxable() && $this->tax_status=='taxable' ) :
$rate = $_tax->get_shipping_tax_rate( $_product->tax_class );
$rate = $_tax->get_shipping_tax_rate( $_product->get_tax_class() );
if ($rate>0) :

View File

@ -62,6 +62,8 @@ For further documentation on using WooCommerce, please sign up for free at http:
* Added woocommerce term meta api
* Added ability to upload category thumbnails
* Added option to show sub-categories when browing categories/the shop page
* Zero tax rate fix
* Filters for tax rates
= 1.0.3 - 06/10/2011 =
* Several minor fixes/tweaks