WordPress at Your Fingertips
function is not described

WC_Cart::get_tax_amount() public WC 1.0

Get a tax amount.

{} It's a 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.

Code of WC_Cart::get_tax_amount() WC 5.6.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;
}