Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

WooCommerce - Direct bank transfer payment method - The instructions field value in the default language is not deleted. This happens when you insert a value to this field and translate it in Strings Translation. But removing the translation and the value of the strings from the field still shows on the front end of the thank you page. It only disappears when you deactivate WPML.

Solution:

The issue has been escalated to our developers. Meanwhile, please use this workaround.

1. Take a backup of your site in case something goes wrong.

2. Edit the following file with a code editor.

\wp-content\plugins\woocommerce-multilingual\inc\class-wcml-wc-gateways.php

(The function is translate_gateway_strings)

3. Replace this line.

if ( isset( $gateway->instructions ) ) {

with this:

if ( !empty( $gateway->instructions ) ) {

4. Save the changes.

Now the problem should be fixed. The once-deleted value from the Instructions field will not show anymore.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps. ****

100% of people find this useful.

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: 

This topic contains 12 replies, has 2 voices.

Last updated by Itamar 1 year, 3 months ago.

Assisted by: Itamar.

Author Posts
September 15, 2023 at 2:16 pm #14403675

nikolaosM

Hello,

i have a problem with the translation of Woocommerce bacs instructions field. I want this field to be empty, but when I remove the content of it, it only shows empty in the english version, which is not the default language of the site. I can't find the string to delete it in string translation or admin screen. I have tried to empty it while greek is selected in admin screen but it keeps on changing the field language to english after i save the changes (see images). I have the latest versions of the plugins, wordpress and theme.

EN Thank you page: hidden link

GR Thank you page: hidden link

Screenshot_2.jpg
Screenshot_1.jpg
September 18, 2023 at 6:52 pm #14415035

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This field should appear in Strings Translation. You should be able to see it under the domain admin_texts_woocommerce_gateways and the name bacs_gateway_description. Please see the attached screenshot. In Strings Translation, you should be able to see it. Please try the following options in the order I present them.

1. The debug info you have attached shows that your server WP Memory Limit is set to 40M. Our recommendations are to have the following as minimal requirements:

- PHP 7 and above (this OK with your installation) with a WP Memory Limit of at least 128MB while 256MB is recommended.

MySQL 5.6 and above.

Please follow this link for detailed documentation:

https://wpml.org/home/minimum-requirements/

Is it possible for you to change those to the minimum requirement?

You may need to contact your hosting provider for that. Meeting those baseline requirements is critical before debugging and sometimes solves issues you experience. (Not being able to find strings in Strings Translation). The most important thing is to raise the WP Memory Limit. Please try to raise it before you contact your hosting company. You can do it from the wp-config.php file in your WordPress installation. Insert this code in that file:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Add it before this line:

/* That's all, stop editing! Happy blogging. */

2. Update WPML (core plugin) to its latest version - 4.6.6 and Strings Translation - 3.2.8. You have previous versions of these plugins.

3. Once you find the Strings Translation in Strings Translation, yu should delete it.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Could you please perform that procedure and see if it helps?

Regards,
Itamar.

2023-09-18_21-43-57.jpg
September 19, 2023 at 8:00 am #14416891

nikolaosM

I did all that you sugested but the issue is not resolved. I haven't yet received any notification to update the plugins you reffered to. I also thing that the string name should be bacs_gateway_instructions, like cod has since instructions is the field that writes content in thank you page and emails.

Screenshot_4.jpg
Screenshot_3.jpg
September 19, 2023 at 12:38 pm #14419517

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for trying my suggestions.

I could not replicate this problem on my WPML and WooCommerce test website.

According to the information you gave me and the screenshot you shared, the site's default language is Greek, and those specific fields were translated from Greek into English. (I can see it in your screenshots because it shows that the original language of those strings is Greek, and they are translated into English because the pencil icon shows next to English.) You should be able to solve this problem by the following steps.

1. In WPML -> Strings Translation, select the bacs_gateway_description and bacs_gateway_instructions strings.

2. Scroll down and press the 'Delete selected strings' button. The translation of the strings into English should then be removed. You will see the plus (+) icon instead of the pencil icon.

3. Make sure that Greek is the selected admin language for your user. (According to the debug information, it is the admin language.) Please read about setting the admin language here.

https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/

4. Go to WooCommerce -> Settings -> Payments -> Bacs, and delete the content of those fields.

5. Press the 'Save changes' button.

This should solve the problem, and the fields should be empty now.

To get the latest versions of our plugins, please go to Plugins → Add New and click the Commercial tab. There, press the 'Check for updates' button. Then you should see that we have new versions. Please read more about hacking for new versions at the following link.

https://wpml.org/faq/install-wpml/#checking-for-updates

Regards,
Itamar.

September 19, 2023 at 1:35 pm #14420039

nikolaosM

This is what i am writting in the previous response. There is no string with name bacs_gateway_instructions, even if the field from woocommerce payments settings is filled or not. I also updated the plugins as you said but it did not fix the problem. I have also scanned the theme and woocommerce.

September 20, 2023 at 6:51 am #14426631

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

You wrote: "There is no string with name bacs_gateway_instructions, even if the field from woocommerce payments settings is filled or not."

I'm sorry, but this confused me because I can see this string in the screenshot you shared yesterday. Please see the attached screenshot where I mark this string.

You also wrote: "I have also scanned the theme and woocommerce."

Thanks for trying that, but this is not what you need to do to find strings that are field values. While on the Strings Translation screen, you need to scroll to the bottom of the page and click the 'Translate texts in admin screens' link. Please read more about it in our guide here.

https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#strings-arent-selected-for-translation

In any case, the strings in Greek should be deleted in WooCommerce -> Settings -> Payments -> Bacs, as I mentioned. If you cannot delete them from there, please let me have access to your site so I can check this issue.

If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

14416891-Screenshot_3_76.jpg
September 21, 2023 at 2:08 pm #14440365

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the access details.

You are correct. I missed the point that the name of the string is cod_gateway_instructions, and I mentioned bacs_gateway_instructions.

But I'm still not sure how to see the problem.

Can you please send me the string value?
Is it "Πληρώστε με μετρητά κατά την παράδοση."?
Can you please tell me where this string shows on the front end?

I don't see it in the links you sent me.
hidden link
hidden link

September 22, 2023 at 7:32 am #14443925

nikolaosM

Hello,

You mentioned cod_gateway_instructions and the string name is bacs_gateway_instructions. The value of this string is empty and it is seted up in Woocommerce -> Settings -> Payments -> Direct bank transfer. The problem is that when i empty it and press update it changes language and it doesn't show empty in the site language. You can see the changes in the links i have sent you. In the english version you don't see the string but in the greek version (site language) you can see it witch is wrong.

September 25, 2023 at 12:24 pm #14458179

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I understand that the issue is not about the bacs_gateway_instructions string.

I'm sorry if I was not clear enough. I think we have a misunderstanding between us. I can not see the string in Greek on the checkout page. I recorded a video to explain what I see better. Please watch the video here.

hidden link

Please share with me a similar video or a screenshot that explains the problem.

September 25, 2023 at 2:35 pm #14459777

nikolaosM

This is my response. hidden link. We can also arange a skype or google meets meating if you want further information. Thanks!

September 25, 2023 at 3:32 pm #14460189

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thank you very much for the video. It helps me a lot to understand the problem.

Tomorrow, I'll continue investigating this problem and update you on my findings.

I appreciate your patience.

September 26, 2023 at 2:19 pm #14467733

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I could replicate this problem on a fresh test site with WPML and WooCommerce. Indeed, while WPML is active, the deleted instructions field still shows even if it was deleted. I've escalated this problem to our second-tier supporters. I'll keep you updated on any news regarding this issue.

September 27, 2023 at 2:01 pm #14474813

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter shares a workaround for this problem.

1. Take a backup of your site in case something goes wrong.

2. Edit the following file with a code editor.

\wp-content\plugins\woocommerce-multilingual\inc\class-wcml-wc-gateways.php

(The function is translate_gateway_strings)

3. Replace this line.

			if ( isset( $gateway->instructions ) ) {

with this:

			if ( !empty( $gateway->instructions ) ) {

4. Save the changes.

Now the problem should be fixed. The once-deleted value from the Instructions field will not show anymore.

The issue has been escalated to our developers. I'll update you here when the fix will be included in future versions of WooCommerce Multilingual & Multicurrency.

Regards,
Itamar.

September 28, 2023 at 11:28 am #14481067

nikolaosM

My issue is solved now. Thank you for the help!