Skip Navigation

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 10 replies, has 2 voices.

Last updated by Mohamed Sayed 1 year, 1 month ago.

Assisted by: Mohamed Sayed.

Author Posts
March 11, 2024 at 9:03 am #15393698

vokos-monoprosopi-saV

Hi
I try to translate the values that i am use the plugin "ELEX Product Price Custom Text" and I am trying to translate Custom Suffix

there hidden link after the price the text have to be "pcs wit VAT" and not "sqm with VAT" as it is now.

i am using this text "sqm with VAT" after the price and is correct there hidden link

March 11, 2024 at 10:35 am #15394204

Mohamed Sayed

Hi,
Thanks for contacting WPML support.

Please try this:

1- Go to WPML String Translation
2- Scroll down to the "Auto register strings for translation" section and enable that option
3- Visit the page where the string is added on the front end
4- Go back to String translation and disable the Auto register option
5- Search again for the string and translate it

If that didn't help, please try the following steps:

1- Go to WPML-> Theme and plugins localization
2- Select the plugin "ELEX Product Price Custom Text" and scan it
3- Go to WPML-> String Translation
4- Scroll down and click on the "Translate texts in admin screens »" link
5- Search for the needed string
6- Select the string and click on the "Add to String Translation" button
7- Then click on "the « Return to String Translation" link
8- Translate the string, clear the cache, and check the front end

Kindly check our guide to know more about translating texts in the admin texts screen. (https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/)

Kind regards,
Mohamed

March 13, 2024 at 1:57 pm #15404327

vokos-monoprosopi-saV

Hi
thank you for your answer
The solution you presented didn't help me
I am using the plugin "ELEX Product Price Custom Tex" and as you can see in the photo I am attaching, I use the option: Use Custom Suffix/Custom Suffix , two different descriptions:
1. in the first case: "τμχ. με ΦΠΑ" this should be translated as "pcs. with VAT"
2. in the second case "τ.μ. με ΦΠΑ" this should be translated as "sqm. with VAT"

but in the secont image that i am attaching in the WPLM/String translation only the one string i can find that "in the second case" and i can not find the "first case" to translate it.

and yet, although I cannot translate it, I see that in the product here hidden link next to the price it has got the translation "sqm with VAT" which should not have had this translation but should have had the translation "pcs. with VAT"

vat2.jpg
vat.jpg
March 13, 2024 at 6:37 pm #15405807

Mohamed Sayed

I would need to request temporary access (WP-Admin) to investigate the issue further.
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website first❌

If you don't see the form below, please don't add your credentials as they will be publicly exposed:
hidden link

Privacy and Security when Providing Debug Information for Support:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

March 14, 2024 at 11:53 am #15409558

Mohamed Sayed

I couldn't find any clues so I'm consulting our 2nd tier supporters about this issue. I will update you once I get their reply.

Kind regards.

March 15, 2024 at 12:55 am #15412576

Mohamed Sayed

I got the reply from our 2nd tier supporters, this could be a compatibility issue.

I have created this clean sandbox setup on our servers here:
hidden link (one-click login)

May I kindly ask you to install the "ELEX Product Price Custom Text" plugin and try to recreate the issue? (WPML and WooCommerce are already installed and configured)

Please don't install anything else like plugins that are not necessary, on a clean sandbox we try to use just the WPML plugins and the plugin/theme that's part of the issue.

If the issue is going to take place on this clean setup on our servers too, then I can forward this to our compatibility department.

Please let me know how that goes and what you can find.

March 15, 2024 at 8:49 am #15413207

vokos-monoprosopi-saV

Hi
thank you very much for your help
I have installed the plugin : "ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount"

The original language is the English, and from this language we will translate into German and Danish

in my example I have passed in the English language 2 products

1. hidden link
2. hidden link

in German
1. hidden link
2. hidden link

in Danish
1. hidden link
2. hidden link

the first language is English, and they should be translated into the other languages:

1. in the first case: "τμχ. με ΦΠΑ" this should be translated as "pcs. with VAT"
2. in the second case "τ.μ. με ΦΠΑ" this should be translated as "sqm. with VAT"

thank you

March 17, 2024 at 11:38 pm #15418966

Mohamed Sayed

Sorry for the late reply due to the weekend.

I escalated this issue to the compatibility team and will let you know once I get any updates.

Kind regards,
Mohamed

March 20, 2024 at 10:31 am #15430400

Mohamed Sayed

Thanks for your patience!

The string is stored as the elex_ppct_custom_fields_suffix custom field inside the product. The expected workflow would be to translate that string with the product.

However, the author does not register this field as translatable. Instead, they register and translate that string with a string translator in SettingsController::elex_ppct_return_wpml_string() - ....../wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/includes/SettingsController.php

This would work correctly if the text is the same on all products, but when you try to define different texts for products, it conflicts.

Workaround:
1. Add the following XML code to WPML > Settings > Custom XML Configuration:

<wpml-config>
  <custom-fields>
    <custom-field action="copy">elex_ppct_custom_fields_checkbox</custom-field>
    <custom-field action="copy">elex_ppct_custom_fields_suffix_checkbox</custom-field>
    <custom-field action="copy">elex_ppct_custom_fields_discount_type_checkbox</custom-field>
    <custom-field action="copy">elex_ppct_custom_fields_prefix</custom-field>
    <custom-field action="copy">elex_ppct_custom_fields_prefix_checkbox</custom-field>
    <custom-field action="copy">elex_ppct_discount_amount</custom-field>
    <custom-field action="copy">elex_ppct_discount_type</custom-field>
    <custom-field action="translate">elex_ppct_custom_fields_suffix</custom-field>
    <custom-field action="translate">elex_ppct_custom_fields_prefix</custom-field>
  </custom-fields>
</wpml-config>

2. Open the ....../wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/includes/SettingsController.php file.

3. Around line 121, replace the following snippet:

public static function elex_ppct_return_wpml_string( $string_to_translate, $name ) {
	// https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-620585
	// https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-620618

With:

public static function elex_ppct_return_wpml_string( $string_to_translate, $name ) {
	
	// WPML Workaround for compsupp-7267
	// We want to disable the rest of the code so it can be translated via custom field translation (instead of String Translator)
	return $string_to_translate;
	
	// https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-620585
	// https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-620618

4. Do a small modification on the original product and save it
5. Update the translation and the text will be included in the translation editor

I tested this on the sandbox site and it works as you can see here:
- hidden link
- hidden link

As this plugin is not listed as compatible https://wpml.org/plugin/, could you please report this issue to the plugin authors?

Kind regards,
Mohamed

Screenshot_800.png
March 20, 2024 at 12:23 pm #15431249

vokos-monoprosopi-saV

this from what i see has solved the problem. Thank you very much.

I have contact with the ELEXtensions and I mentioned issue to them
if they reply I will let you know

thank you very much for your great help

March 20, 2024 at 12:41 pm #15431446

Mohamed Sayed

I'm glad to hear that the issue is resolved.

Please feel free to contact us again if you have any further questions or issues, we will be always happy to help.