This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is trying to translate a string in WooCommerce transactional emails that is added via a custom YayMail hook. The string displays correctly in English but the translated version does not appear in the final email, despite being visible in WPML's string translation table.
Solution:
1. We asked the client to share the code used to add the text to determine if the issue is specific to WooCommerce or another plugin.
2. We suggested adding the text via extra content inside the Email builder to manage different language content, as detailed in our documentation: https://docs.yaycommerce.com/yaymail/integrations/wpml-and-woocommerce-multilingual
3. We recommended trying to add a string as shown in our example documentation to see if that translates. If successful, the client should adjust their current code accordingly. Example code provided:
<p><?php printf( _e( 'CUSTOM TEXT', 'woocommerce' ); ?></p>
Further documentation can be found here: https://wpml.org/documentation/related-projects/woocommerce-multilingual/how-to-translate-woocommerce-emails
4. If these steps do not resolve the issue, we recommended setting up a sandbox test website to reproduce the case for further consultation.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Exception
This topic contains 7 replies, has 0 voices.
Last updated by ielyzavetaS 1 month, 1 week ago.
Assisted by: Dražen.
Author | Posts |
---|---|
April 10, 2025 at 4:47 pm #16919897 | |
ielyzavetaS |
Background of the issue: Symptoms: Questions: |
April 15, 2025 at 6:22 am #16931632 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, thanks for contacting us. 1) Can you please share the code you used to add the text? 2) Did you try to add that text via extra content inside Email builder and in that way add different language content? - hidden link Regards, |
April 15, 2025 at 11:13 am #16933679 | |
ielyzavetaS |
Hello Drazen, Thanks for your response. What else is needed from my end for debugging? |
April 15, 2025 at 11:25 am #16933804 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thanks for getting back. 1) You mentioned woocommerce_email_before_order_table, that is WC hook, so the issue should happen also without YayMail addon, right? Can you please test? 2) Please share the hook snippet you added. Regards, |
April 22, 2025 at 10:50 am #16954618 | |
ielyzavetaS |
Hello Drazen, I'm sorry for taking this so long. 1. Yes, these fields are localized in the UI (see the screenshot). <?php namespace Iwpdev\FlatsomeChild\WooCommerce; use WC_Checkout; /** /** /** if ( $unknown_address === 'yes' ) { if ( ! empty( $phone_field ) ) { if ( 'yes' === $photo_to_email_address ) { /** if ( empty( $nip ) ) { return $allowed; /** echo '<div id="company_name_field" style="display:none;">'; /** echo '<div id="receiver_phone_field" style="display:none;">'; /** if ( ! empty( $_POST['company_name'] ) ) { if ( ! empty( $_POST['company_address'] ) ) { if ( ! empty( $_POST['company_nip'] ) ) { /** if ( ! empty( $_POST['receiver_phone'] ) ) { /** if ( $not_vat === 'yes' ) { if ( $company_address ) { if ( $company_nip ) { /** if ( $unknown_address === 'yes' ) { if ( 'yes' === $photo_to_email_address ) { /** if ( ! empty( $invoice_number ) ) { /** return $fields; /** /** |
April 22, 2025 at 11:08 am #16954715 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, thanks, so as I can see, you are editingthe Flatsome child theme and adding custom code/string there. 1) Does the issue happen with only WPML plugins and WooCommerce, all other disabled? 2) Are you adding any other custom code to your child theme? 3) If the issue still happens after step 1, can you please go to the next test site and try to reproduce the same issue. Share steps with me what have you done. I suspect issue is with custom code, but since we can not support custom code / solutions I am trying to see the issue in example / minimal test site, so I can easily consult with our 2nd tier. - hidden link Let me know how it goes. Regards, |
April 22, 2025 at 11:33 am #16955002 | |
ielyzavetaS |
Hello Drazen, Thanks for getting back to me. 1. Plugin Deactivation: 2. Custom Code: 3. Sandbox Testing: 4. Environment Details: - WordPress version: 6.7.2 Let me know how you'd like us to proceed regarding the hook behavior — happy to test further if needed. Kind regards, |
April 22, 2025 at 12:48 pm #16955315 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello Elizabeth, 1) I know, but we need to confirm if issue is related to only WooCommerce or any other plugin or your website specifically, so that is one way to move forward with debugging the issue. 3) I think it should support. What you can try is add a string as in our example docs, see if that translates and if yes adjust your current code with same. <p><?php printf( _e( 'CUSTOM TEXT', 'woocommerce' ); ?></p> If nothing helps, then the best and quickest would be to move with a sandbox test website, reproduce the case, and then I can consult further on this with our 2nd tier. Regards, |
April 26, 2025 at 7:56 am #16970413 | |
ielyzavetaS |
Hello Drazen, Thank you for your pieces of advice. <?php printf( _e( The ticket can be closed. BR, |