WC_Cart::get_taxes_total PHP Method

get_taxes_total() public method

Get tax row amounts with or without compound taxes includes.
public get_taxes_total ( boolean $compound = true, boolean $display = true ) : float
$compound boolean True if getting compound taxes
$display boolean True if getting total to display
return float price
    public function get_taxes_total($compound = true, $display = true)
    {
        $total = 0;
        foreach ($this->taxes as $key => $tax) {
            if (!$compound && WC_Tax::is_compound($key)) {
                continue;
            }
            $total += $tax;
        }
        foreach ($this->shipping_taxes as $key => $tax) {
            if (!$compound && WC_Tax::is_compound($key)) {
                continue;
            }
            $total += $tax;
        }
        if ($display) {
            $total = wc_round_tax_total($total);
        }
        return apply_filters('woocommerce_cart_taxes_total', $total, $compound, $display, $this);
    }
WC_Cart