WordPress at Your Fingertips
function is not described

WC_Cart::get_taxes_total() public WC 1.0

Get tax row amounts with or without compound taxes includes.

{} It's a method of the class: WC_Cart{}

Hooks from the method
Return

float. price

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_taxes_total( $compound, $display );
$compound(true|false)
True if getting compound taxes.
Default: true
$display(true|false)
True if getting total to display.
Default: true

Code of WC_Cart::get_taxes_total() WC 5.6.0

public function get_taxes_total( $compound = true, $display = true ) {
	$total = 0;
	$taxes = $this->get_taxes();
	foreach ( $taxes as $key => $tax ) {
		if ( ! $compound && WC_Tax::is_compound( $key ) ) {
			continue;
		}
		$total += $tax;
	}
	if ( $display ) {
		$total = wc_format_decimal( $total, wc_get_price_decimals() );
	}
	return apply_filters( 'woocommerce_cart_taxes_total', $total, $compound, $display, $this );
}