Fixed method returning value in write content warning in legacy PHP

This commit is contained in:
Claudio Sanches 2017-10-27 16:01:33 -02:00
parent ef7f3dde70
commit 1008ad1203
1 changed files with 3 additions and 2 deletions

View File

@ -301,12 +301,13 @@ function wc_cart_totals_order_total_html() {
// If prices are tax inclusive, show taxes here.
if ( wc_tax_enabled() && WC()->cart->tax_display_cart == 'incl' ) {
$tax_string_array = array();
$cart_tax_totals = WC()->cart->get_tax_totals();
if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) {
foreach ( WC()->cart->get_tax_totals() as $code => $tax ) {
foreach ( $cart_tax_totals as $code => $tax ) {
$tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label );
}
} elseif ( ! empty( WC()->cart->get_tax_totals() ) ) {
} elseif ( ! empty( $cart_tax_totals ) ) {
$tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() );
}