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
Return Return
(float) price
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 ); }