Skip Navigation

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

Problem:
If you're experiencing issues where prices change incorrectly when the String Translation plugin is enabled, it might be due to custom code in your theme. Specifically, the issue arises from a line in the child theme's

functions.php

file that incorrectly replaces text related to price display.
Solution:
We recommend checking the

functions.php

file in your child theme, specifically around line 51. Look for the following line of code:

$translated_text = str_ireplace('Price', 'Cena', $translated_text);

To resolve the issue, you can either comment out or remove this line. This change should correct the price display by preventing the alteration of admin string names that affect how prices are shown.

Please note that this solution might be irrelevant if it's outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

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

Last updated by Bruno Kos 3 weeks, 2 days ago.

Assisted by: Bruno Kos.

Author Posts
October 17, 2024 at 11:03 am

ziga pipan

Background of the issue:
Prices go from this
hidden link

to this
hidden link

when Strin translation plugini is enabled

Symptoms:
Prices go from this
hidden link

to this
hidden link

when Strin translation plugini is enabled

Questions:
what to do?

October 17, 2024 at 11:25 am
October 17, 2024 at 1:25 pm #16300411

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you try this:

1. **Navigate to the following directories** in your WordPress installation:
- `wp-content/languages/wpml/`
- `wp-content/languages/themes/`
- `wp-content/languages/plugins/`

These folders contain the `.mo` files associated with WPML, your theme, and WooCommerce/WooCommerce Multilingual.

2. **Identify the .mo files** related to:
- Your active them
- WooCommerce and WooCommerce Multilingual
- WPML-related files

3. **Rename the .mo files one by one**:
- Start by renaming a `.mo` file to something like `filename.mo2`.
- Begin with files in the `wpml` folder, and then move on to files in the `themes` and `plugins` folders.

4. **Test the website after renaming each file**:
- Check if the issue persists after each renaming.
- This will help identify if a specific `.mo` file is causing the problem.

5. **Repeat the process for each relevant `.mo` file** until you've located the problematic one.

Let us know if you need further assistance during this process!

October 17, 2024 at 2:24 pm #16300962

ziga pipan

Thank you

1.
There is not THEMES folder in LANGUAGES

2.
how do I indentify the .mo files** related to those three things?

October 21, 2024 at 7:51 am #16310543

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

To identify the .mo files related to your theme, WooCommerce, and WPML:

1. **Theme**: Look for .mo files containing the name or slug of your active theme (e.g., `yourthemename.mo`).
2. **WooCommerce**: Look for .mo files that include `woocommerce` or `wcml` in the filename.
3. **WPML**: Look for .mo files that have `wpml` or `wpml-` in the filename.

Does it help?

October 21, 2024 at 4:27 pm #16313686

ziga pipan

I did not rename but deleted all the files but the problem still remains.

October 22, 2024 at 5:08 am #16314937

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

To troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size. You can find more information about the process here: [link](https://wpml.org/faq/provide-supporters-copy-site/). Please confirm if this approach is acceptable to you.

October 22, 2024 at 9:05 am #16315975

ziga pipan

of course, thank you.

PS: note that I'll be on vacation for the next 10 days and might be a bit late on replies.

October 22, 2024 at 10:03 am #16316269

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

No worries about that, enjoy your vacation!

This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

October 22, 2024 at 10:07 am #16316286

ziga pipan

many thanx!

October 22, 2024 at 11:55 am #16317253

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Upon investigating the issue, we found that it stems from the following line in the child theme's `functions.php` file:

$translated_text = str_ireplace('Price', 'Cena', $translated_text);

This line is located within the `custom_text` function on line 51. If you either comment out or remove this line, the price should display correctly.

The problem arises because this line changes the admin string name from `woocommerce_price_decimal_sep` to `woocommerce_Cena_decimal_sep`, which is causing the issue.