[Resolved] Products have moved from one language to another
This thread is resolved. Here is a description of the problem and solution.
Problem: The client encountered an issue where products imported in Italian were automatically moved to Lithuanian after running a cron job for updating product information using WPML and WP All Import Multilingual plugin. Solution: We discovered that the problem occurs because the Italian language was set to hidden. When a language is hidden, and a cron job is executed, WPML defaults to creating the product in the primary language instead of the intended hidden language. This is due to hidden languages being visible only to logged-in users, and therefore, not accessible to cron requests. To resolve this, we recommend: 1. Unhide the Italian language. 2. Import the products as drafts. 3. Publish the products once they are ready.
Please note that this solution might not apply to your situation if it's outdated or not relevant to your specific case. If the issue persists, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, 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.
We have a strange problem. Our website is available in several languages. We are using WPML and WP All Import Multilingual plugin. We have imported the products from the supplier file into Italian language. When we ran a cron command to automatically update the product information from the supplier file, the products moved from Italian to Lithuanian. They should have remained in Italian.
Before this is taken by a colleague, let me share some thoughts and get some more information.
What you are describing is certainly unexpected. It may not help much now, but for future reference you should always time a backup before conducting bulk operations on your site so that you can revert if problems arise. (If you do have a backup, that will be the simplest solution.)
WP All Import Pro includes extensive logs for each operation which may contain clues as to why this happened; we'd need to take a look at those logs, as well as check the import settings and see details of the file being imported.
So let me request access to your site if that's okay so we can take a look.
We may need to propose a code snippet to perform a batch operation to update the language of the affected products to revert them to Italian.
Where there any other jobs run at about the same time?
We checked the site and found that in the WPML All Import metabox, the language is set to Italian but the "Automatic Record Matching to Translate" is set to Import data in main language (Lithuanian) which is incorrect hidden link
You need to expand the "Automatic Record Matching to Translate" section, select the Define parent import option then select the file that you used to import the default language posts and make sure the Unique Identifier is the same as the one set during the default language import.
We need to import the products in Italian only and update the stock and prices in Italian via cron command. However, when the cron command is executed, the products are moved from Italian to English. It should remain in Italian.
I checked again with the 2nd tier support team, we didn't test if importing the products is supposed to work in this way. Please run an import and then run the corn again and let us know if the same issue happens.
We need to check if the problem is the Cron or updating the products.
Hi, we checked it again. When starting the import system via the dashboard, the products are settling fine, in Italian. Also, they remain in Italian if we restart the import via the dashboard by updating the existing imported products. However, when running the cron command, the products move to Lithuanian, should remain in Italian.
The plugin will create a package file that you can download then upload again to Google Drive or Dropbox and share the download link in the next reply which I have marked as private. Then we will escalate this issue to our developers.
I got the reply from our developers, the provided package is incomplete missing the WP files and most importantly wp-content folder that contains plugins/themes.
They also tried to replicate this in a clean installation with the same steps, but it worked fine. When updating posts using CRON the posts remain in 2nd language even without importing them first in the primary language.
Hello, well then we give you permission to make a copy with All-in-One WP Migration plugin or any other one, because Duplicator doesn't prepare all files for some reason.
Our developers found that this issue happens because the Italian language is hidden. When you hide the language then the Cron runs, WPML creates the product in the primary language instead of Italian.
This is because the language is not active and hidden languages are only visible to logged-in users so CRON requests can not find it.
Please unhide the language and instead you can import the product as draft and then publish them later.