WC_Cart::get_taxes_total( bool $compound = true, bool $display = true )

Get tax row amounts with or without compound taxes includes.


Description Description


Parameters Parameters

$compound

(Optional) True if getting compound taxes.

Default value: true

$display

(Optional) True if getting total to display.

Default value: true


Top ↑

Return Return

(float) price


Top ↑

Source Source

File: includes/class-wc-cart.php

	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 += wc_round_tax_total( $tax );
		}
		if ( $display ) {
			$total = wc_format_decimal( $total, wc_get_price_decimals() );
		}
		return apply_filters( 'woocommerce_cart_taxes_total', $total, $compound, $display, $this );
	}


Top ↑

User Contributed Notes User Contributed Notes

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