Conversation
supportHi. I believe the mailchimp_woocommerce_newsletter_field doesn’t work when using block-based checkout, correct? I’m referring to https://github.com/mailchimp/mc-woocommerce/wiki/Filter-on-newsletter-field#checkout-page-hook If that’s the case, how to we change the label? It’s not editable in block settings.
Hey @bugnumber9 You’re absolutely correct! The mailchimp_woocommerce_newsletter_field filter hook does not work with WooCommerce’s block-based checkout . This is a known limitation because the block-based checkout uses a different rendering system than the traditional checkout hooks. Workarounds and Solutions: Unfortunately, there isn’t currently a direct way to customize the newsletter checkbox label in the block-based checkout through the plugin’s existing filter system. This request is with our dev team to prioritize a solution – until then, here are your options: Option 1: Use Classic Checkout If label customization is critical, you might consider reverting to the classic checkout template, where the filter hooks work as expected. Option 2: Custom Block Development You would need to create a custom checkout block or modify the existing Mailchimp block through WooCommerce’s block extension system, but this requires significant development work. Option 3: JavaScript/CSS Workaround As a temporary solution, you could use JavaScript to modify the label text after the page loads, though this isn’t ideal from a user experience perspective. Hopefully this helps – remember to check github periodically for feature updates.
What about translating text via adding the following below to the functions.php file of your site’s child theme–would this maybe work as another option? // Change text as listed below add_filter('gettext', 'translate_text'); function translate_text($translated) { $translated = str_ireplace('Current text you want changed', 'New text you want displayed', $translated); // Note where modified text is on site return $translated; }
Hey @bugnumber9 You’re absolutely correct! The mailchimp_woocommerce_newsletter_field filter hook does not work with WooCommerce’s block-based checkout . This is a known limitation because the block-based checkout uses a different rendering system than the traditional checkout hooks. Workarounds and Solutions: Unfortunately, there isn’t currently a direct way to customize the newsletter checkbox label in the block-based checkout through the plugin’s existing filter system. This request is with our dev team to prioritize a solution – until then, here are your options: Option 1: Use Classic Checkout If label customization is critical, you might consider reverting to the classic checkout template, where the filter hooks work as expected. Option 2: Custom Block Development You would need to create a custom checkout block or modify the existing Mailchimp block through WooCommerce’s block extension system, but this requires significant development work. Option 3: JavaScript/CSS Workaround As a temporary solution, you could use JavaScript to modify the label text after the page loads, though this isn’t ideal from a user experience perspective. Hopefully this helps – remember to check github periodically for feature updates.
What about translating text via adding the following below to the functions.php file of your site’s child theme–would this maybe work as another option? // Change text as listed below add_filter('gettext', 'translate_text'); function translate_text($translated) { $translated = str_ireplace('Current text you want changed', 'New text you want displayed', $translated); // Note where modified text is on site return $translated; }