WC_Cart::get_tax_amount( string $tax_rate_id )

Get a tax amount.


Description Description


Parameters Parameters

$tax_rate_id

(Required) ID of the tax rate to get taxes for.


Top ↑

Return Return

(float) amount


Top ↑

Source Source

File: includes/class-wc-cart.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.