If no tax rate is defined for a specific country it still shows "incl. VAT" at the checkout / cart when tax display is set to "As single total". This will solved that

This commit is contained in:
Chris Schrijver 2017-10-11 17:58:43 +02:00
parent ce47fa65c2
commit dee7a8c8d4
1 changed files with 3 additions and 1 deletions

View File

@ -307,7 +307,9 @@ function wc_cart_totals_order_total_html() {
$tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label ); $tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label );
} }
} else { } else {
$tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() ); if( ! empty( WC()->cart->get_tax_totals() ) ) {
$tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() );
}
} }
if ( ! empty( $tax_string_array ) ) { if ( ! empty( $tax_string_array ) ) {