diff --git a/includes/wc-cart-functions.php b/includes/wc-cart-functions.php index 6e48c4fc577..1d159c7d55a 100644 --- a/includes/wc-cart-functions.php +++ b/includes/wc-cart-functions.php @@ -316,15 +316,16 @@ function wc_cart_totals_order_total_html() { if ( ! empty( $tax_string_array ) ) { $taxable_address = WC()->customer->get_taxable_address(); - /* translators: %s: country name */ - $estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ? sprintf( ' ' . __( 'estimated for %s', 'woocommerce' ), WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] ) : ''; - $value .= '(' - /* translators: includes tax information */ - . esc_html__( 'includes', 'woocommerce' ) - . ' ' - . wp_kses_post( implode( ', ', $tax_string_array ) ) - . esc_html( $estimated_text ) - . ')'; + if ( WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ) { + $country = WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ]; + /* translators: 1: tax amount 2: country name */ + $tax_text = wp_kses_post( sprintf( __( '(includes %1$s estimated for %2$s)', 'woocommerce' ), implode( ', ', $tax_string_array ), $country ) ); + } else { + /* translators: %s: tax amount */ + $tax_text = wp_kses_post( sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) ) ); + } + + $value .= '' . $tax_text . ''; } }