Merge branch 'pr/22488'

This commit is contained in:
Mike Jolley 2019-01-21 15:39:00 +00:00
commit d096d17d25
1 changed files with 5 additions and 2 deletions

View File

@ -485,7 +485,10 @@ final class WC_Cart_Totals {
return array(); return array();
} }
$tax_class = $item->product->get_tax_class(); $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() ); $item_tax_rates = 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() );
// Allow plugins to filter item tax rates.
return apply_filters( 'woocommerce_cart_totals_get_item_tax_rates', $item_tax_rates, $item, $this->cart );
} }
/** /**