[Resolved] prices messed up when I enable string translation
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:
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.
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!
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.
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.
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.
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.