Skip Navigation

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

Problem:
Client reported that product gallery images were not appearing in translations within the WP Admin. The client managed to partially solve the issue by using an advanced SQL query and a PHP script, identifying that WPML was not handling situations where an image associated with a product did not have a corresponding file on the server, which seemed to cause a block in script execution.

We also 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 further assistance is needed, please contact us in the WPML support forum.

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 28 replies, has 3 voices.

Last updated by Andrey 10 months, 3 weeks ago.

Assisted by: Andrey.

Author Posts
April 5, 2024 at 12:28 pm #15488169

shanyM

yeah feel free to do it, all we want its site to work as fast as possible. we also have a copy in stage environemenr under dev123

April 5, 2024 at 1:42 pm #15488379

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I noticed you reset the WPML plugin, which is now not configured. Will you revert a copy of your staging site where the issue reported is replicated so I can take a copy and check it further on the local environment?

April 5, 2024 at 1:53 pm #15488432

shanyM

i make some test in the stage environment. I will restore it. but you can directly use live website for make your local copy.

April 8, 2024 at 8:59 am #15493173

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I just wanted to let you know that I used your test site again to conduct some testing. During the process, I activated and configured the WPML plugin. Afterward, I deactivated all plugins except for WPML, WooCommerce, and WooCommerce Multilingual & Multicurrency.

To check the galley images issue, I selected the product KIT COMPLET COUPE-FROID BLANC TOUR DE PORTE ACIER - 223-BLANC as an example, which you mentioned earlier. However, I didn't find any issue with the gallery images. All gallery images were displayed correctly in the translations of this product. Additionally, when I deleted any existing image or added a new one and updated the product, all those changes were successfully applied to the translated product as well.

Could you please double-check this and let me know?

KIT-COMPLET-COUPE-FROID-BLANC-TOUR-DE-PORTE-ACIER-–-223-BLANC-–-Pièces-de-fenêtres-et-portes-–-PE-Fraser.png
COMPLETE-WHITE-WEATHER-STRIPPING-KIT-STEEL-DOOR-TOWERS-–-223-WHITE-–-Windows-and-doors-parts-–-PE-Fraser.png
April 8, 2024 at 1:53 pm #15494539
shanyM

You just send us a photo of the pefraser.com website.

We never talked about an issue about how it's display on the website. We used a special way to make photo appear on website waiting for this issue to be solve. So you cannot check website to check if it's working. We are the one who handle the website, what we request you is about the back end. I'm talking about inside admin panel, when we go in product.

I repeat, we don't talk about the website but inside WordPress admin panel. Image gallery and category both did't get converted well by WPML.

- For Category, some are missing and not been created.
- For product, image gallery did't get transfered to English product, making amazon also did't work,

This problem is a emergency and need a serious attention to be solve. Look screenshot and make effort to understand it.

New threads created by Andrey and linked to this one are listed below:

https://wpml.org/forums/topic/split-for-category-some-are-missing-and-not-been-created/

imagegallery1.png
imagegallery2.png
April 8, 2024 at 2:45 pm #15494975

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I understand that you are having trouble with the product image gallery on your website in the backend. Please note that WPML provides good support for the product image gallery. I have also tested this on a fresh local installation. To translate products, we recommend using the WooCommerce Multilingual screen instead of the native WordPress screen. So, the users are not bothered with the backend information of the translated product which are copied.

It's possible that WPML is unaware of a special way you display/upload your images, especially if third-party services are involved. If this is the case, custom coding may be required, which is beyond the scope of the support provided here.

Can you please confirm if you are able to view the uploaded images in the backend when using the usual method of adding them to the product gallery?

It may be necessary to try running the following options each time you upload images in an unusual way to see if they help, but please note that I cannot guarantee that they will solve the issue:
- Run the media translation option in WPML → Media Translation.
- Run the "Sync products gallery images" option in WooCommerce → WooCommerce Multilingual & Multicurrency → Status, and click on the troubleshooting link.

April 8, 2024 at 2:53 pm #15495089

shanyM

every single image in the backend as been uploaded manually using wordpress method. But still they conter part in english never get updated even if been created by WPML. We do not use any special plugin to upload photo. if we go in english product and then add photo manually we will see it of course. Our issue its that photo if french product gallery not been transfered in english product photo gallery. All step mentioned dont solve our issue. something go wrong with WPML and need investigation. You also did't anwserd for category that not been translated.

April 8, 2024 at 4:02 pm #15495465

shanyM

I jsut make many test. Here my theory.
When we instaleld WPML, media translation was not installed.
If i add image to a product it work and appear in both langage. It's mean the update button trigger to corect that.

But for all image that was existing prior to the WPML media translation, image never got synchronize. If i delete all image in french and reupload them it will work but will take an eternity.

You should have an option to handle this situation.

April 9, 2024 at 7:34 am #15497166

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for giving your feedback.

Under a special way, I assumed that they were uploaded using some third-party plugin or service. As I mentioned earlier, WPML was deactivated on your staging site. I reconfigured it, and the images seem to appear now, but I am unsure. I just checked a few random products on your staging and found that the product gallery exists in English when editing products.

Did you reset WPML on your staging site? Could you create a fresh copy and update your staging site? I attempted to create a copy for local testing, but the existing one is quite large.

April 9, 2024 at 7:44 am #15497212

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I opened a new ticket for your new question. This will also help other users with similar problems find solutions when searching the forum. I will reply you here: https://wpml.org/forums/topic/split-for-category-some-are-missing-and-not-been-created/

April 10, 2024 at 3:48 am #15502026

shanyM

you told you download the website locally so we did make some test.
Special way is sql query to put data at right place .

The gallery do exist in english but have missing image.
We can't wait the long deley to get anwser so we have to make some test.
We are actually able to make them appear with a query.

UPDATE wp_postmeta AS pm_en
INNER JOIN wp_icl_translations AS t_en ON pm_en.post_id = t_en.element_id
INNER JOIN wp_icl_translations AS t_fr ON t_en.trid = t_fr.trid AND t_fr.language_code = 'fr'
INNER JOIN wp_postmeta AS pm_fr ON t_fr.element_id = pm_fr.post_id
SET pm_en.meta_value = pm_fr.meta_value
WHERE t_en.language_code = 'en'
AND t_en.element_type = 'post_product'
AND pm_en.meta_key = '_thumbnail_id'
AND pm_fr.meta_key = '_thumbnail_id';

UPDATE wp_postmeta pm_en
INNER JOIN (
SELECT
pm_fr.post_id AS french_product_id,
pm_fr.meta_value AS gallery_ids,
p_en.ID AS english_product_id
FROM wp_postmeta pm_fr
INNER JOIN wp_posts p_fr ON pm_fr.post_id = p_fr.ID
INNER JOIN wp_icl_translations t_fr ON p_fr.ID = t_fr.element_id
AND t_fr.element_type LIKE 'post_product%'
AND t_fr.language_code = 'fr'
INNER JOIN wp_icl_translations t_en ON t_fr.trid = t_en.trid
AND t_en.element_type LIKE 'post_product%'
AND t_en.language_code = 'en'
INNER JOIN wp_posts p_en ON t_en.element_id = p_en.ID
WHERE pm_fr.meta_key = '_product_image_gallery'
) AS mapping ON pm_en.post_id = mapping.english_product_id
SET pm_en.meta_value = mapping.gallery_ids
WHERE pm_en.meta_key = '_product_image_gallery';

There query are able to make appear product in english but still not perfect as it seem they end up disapearing eventualy.

Next try will be to create a script who delete and put back image using publish button. I dont understand you cant see missing image gallery inside wp-admin.

April 10, 2024 at 8:29 am #15502729

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I inquired about the possibility of replicating your website locally, but I faced an issue as the size of the site is about 26GB. Due to this, I was unable to obtain a proper copy of the site.

Is it possible to provide a copy of your live site? I am able to view the missing images with product galleries for the English products when editing them with WordPress editor on the live site, but not the staging site.

Please keep in mind that custom queries are not something we can provide support for.

April 10, 2024 at 1:59 pm #15505313

shanyM

you already asked for a copy of the site on stage environment and we already provide it. It's dev123.pefraser.com You will not see issue on the site. Don't even go on the site, I keep and alway talked about wordpress product editor. For the custom query, they are made in some of our stage enviroment to see what working.

April 10, 2024 at 2:26 pm #15505363

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I'm sorry that you ran into trouble with this. I totally understand the issue you reported. However, your staging website changes by someone doing some work don't allow us to keep checking what you have reported.

To assist you better, I need to see the issue you reported (before any custom queries were applied) with the ability to run tests and your help in creating a copy for testing the issue on the local environment.

April 15, 2024 at 5:03 am #15516989

shanyM

by the way i solved part of the issue using advenced sql qury and php script for find out where it blocking. seem that WPML dont handle very well when a image associate to a product dont actually really have a file on the server. So corruption litterally seem to block script from executing corectly.