WPML

Overview of the Issue

When using MailChimp for WooCommerce with WPML, you might experience the following issue: the newsletter checkbox label shows in the default language on the checkout of your secondary languages, also after you translate it in WPMLString Translation (6.0 and later).

Workaround

Go to WPMLSettingsCustom XML Configuration, add this code and save:

XML
<wpml-config><admin-texts><key name="mailchimp-woocommerce"><key name="newsletter_label"/></key></admin-texts></wpml-config>
Then add this code to your theme’s functions.php file:
PHP
add_filter( 'mailchimp_woocommerce_newsletter_field', function ( $html, $status, $label ) {
  $t = apply_filters( 'wpml_translate_single_string', $label, 'admin_texts_mailchimp-woocommerce', '[mailchimp-woocommerce]newsletter_label' );
  return is_string( $t ) && '' !== $t && $t !== $label ? str_replace( '<span>' . $label . '</span>', '<span>' . esc_html( $t ) . '</span>', $html ) : $html;
}, 10, 3 );
Then translate the label in WPMLString Translation.

All known issues

Need Help with This Issue?

Ask a support question and we’ll look into it with you.