WC_Cart::get_taxes_total() public WC 1.0
Get tax row amounts with or without compound taxes includes.
{} Это метод класса: WC_Cart{}
Хуки из метода
Возвращает
float. price
Использование
$WC_Cart = new WC_Cart(); $WC_Cart->get_taxes_total( $compound, $display );
- $compound(true/false)
- True if getting compound taxes.
- $display(true/false)
- True if getting total to display.
Код WC_Cart::get_taxes_total() WC Cart::get taxes total WC 5.0.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 );
}