woocommerce_cart_totals_get_item_tax_rates

This commit is contained in:
Mike Jolley 2019-01-21 15:38:48 +00:00
parent 3a2b3d10ad
commit 2d14315f3d
1 changed files with 5 additions and 4 deletions

View File

@ -484,10 +484,11 @@ final class WC_Cart_Totals {
if ( ! wc_tax_enabled() ) {
return array();
}
$tax_class = $item->product->get_tax_class();
$taxrates = 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() );
$taxrates = apply_filters( 'woocommerce_item_tax_rates', $taxrates, $item, $this->cart );
return $taxrates;
$tax_class = $item->product->get_tax_class();
$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 );
}
/**