WC_Cart::get_shipping_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_shipping_tax_amount( $tax_rate_id );
$tax_rate_id(string) (required)
ID of the tax rate to get taxes for.

WC_Cart::get_shipping_tax_amount() code WC 8.7.0

public function get_shipping_tax_amount( $tax_rate_id ) {
	$taxes = $this->get_shipping_taxes();
	return isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0;
}