Variation tax status should always come from parent

This commit is contained in:
Mike Jolley 2015-07-15 19:12:12 +01:00
parent db61edcb36
commit f42fa85eab
2 changed files with 11 additions and 2 deletions

View File

@ -488,7 +488,7 @@ class WC_Product {
* @return bool
*/
public function is_taxable() {
$taxable = $this->tax_status == 'taxable' && wc_tax_enabled() ? true : false;
$taxable = $this->get_tax_status() === 'taxable' && wc_tax_enabled() ? true : false;
return apply_filters( 'woocommerce_product_is_taxable', $taxable, $this );
}
@ -498,7 +498,7 @@ class WC_Product {
* @return bool
*/
public function is_shipping_taxable() {
return $this->tax_status=='taxable' || $this->tax_status=='shipping' ? true : false;
return $this->get_tax_status() === 'taxable' || $this->get_tax_status() === 'shipping' ? true : false;
}
/**

View File

@ -409,6 +409,15 @@ class WC_Product_Variation extends WC_Product {
return true === $this->managing_stock() ? wc_stock_amount( $this->stock ) : $this->parent->get_stock_quantity();
}
/**
* Returns the tax status. Always use parent data.
*
* @return string
*/
public function get_tax_status() {
return $this->parent->get_tax_status();
}
/**
* Returns whether or not the product is in stock.
*