WC_Cart::get_tax_amount()publicWC 1.0

Get a tax amount.

Method of the class: WC_Cart{}

No Hooks.

Return

float. amount

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_tax_amount( $tax_rate_id );
$tax_rate_id(string) (required)
ID of the tax rate to get taxes for.

WC_Cart::get_tax_amount() code WC 8.7.0

public function get_tax_amount( $tax_rate_id ) {
	$taxes = wc_array_merge_recursive_numeric( $this->get_cart_contents_taxes(), $this->get_fee_taxes() );
	return isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0;
}