Skip Navigation

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

Problem:
The client is experiencing issues with media attachments not automatically uploading to custom product galleries in the translated versions of their 'Accessories' custom post type. Despite images appearing translated in Media Translation, they are not uploaded to corresponding posts.
Solution:
We recommend the following steps to potentially resolve the issue:
1. Navigate to WPML → Settings → Custom Fields Translation. Activate the option "Show 'Multilingual Content Setup' meta box on the edit screen" and save your changes.
2. Go to the "Accessories" post type and edit a custom post.
3. While editing, scroll down to the bottom of the "Custom Fields" section.
4. Click on "Show system fields" to locate the related fields.
5. Set those custom fields to "Copy".
Please note that the plugin used for the custom post type has not been tested for compatibility with WPML, which might lead to compatibility issues. Check the plugin's compatibility at this link.

If this solution does not resolve your issue or seems outdated, 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 at 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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Andrey 2 weeks, 1 day ago.

Assisted by: Andrey.

Author Posts
October 21, 2024 at 2:05 pm #16312692

vadimP

Background of the issue:
Our team has run into an issue with media attachments (product galleries) in translated content on our site hidden link. The 'Accessories' section is a custom type section that works like Woocommerce products but is separate from them. We are trying to ensure that images are uploaded to product galleries automatically when they're translated.

Example of missing product gallery images:
hidden link
hidden link

Symptoms:
All content is synced correctly between translations except for product gallery. Images appear translated in Media Translation but are not uploaded to corresponding posts.

Questions:
Our team is aware that we can go through Settings > Media translation for a full sync, however it is not viable on this website as it contains a very large quantity of products/images and syncing everything takes hours upon hours. If this re-sync is necessary every time a couple of new accessories are added, it will take an unreasonable amount of time.
Is it possible some settings need to be added or adjusted for this custom type post specifically so that images are uploaded to galleries automatically when they're translated?
Is there a way to re-sync media only for selected post type?

October 23, 2024 at 9:54 am #16321148

vadimP

Hello, did you had a chance to look at our request?

October 24, 2024 at 7:18 pm #16328163

Andrey
Supporter

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

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

Thank you for contacting WPML support, and I apologize for the delay.

Could you please provide more background on the 'Accessories' section? How does it work, and how do you upload images to the gallery within that section?

Essentially, when you create a custom post and upload images, those images should automatically copy over after completing the translation. Please ensure that the options "Duplicate uploaded media to translations" and "Duplicate featured image to translations" are activated. I have attached the screenshot.

Edit-Post-“Hello-world-”-‹-wpmlsite-—-WordPress.png
October 25, 2024 at 1:38 pm #16330947

vadimP

Hi,

Accessories are imported from a csv file, including all translations. Some images are imported from the file as well, others are added manually in WP admin after the import.

The two checkboxes that you mentioned are activated, however when product gallery images are added manually to the main language (LV), they are still not duplicated to other languages automatically.

This option works just fine for all other post types on our website, including Woocommerce products. Accessories is essentially a custom copy of Woocommerce products, yet the behaviour is different when it comes to product gallery specifically.

October 28, 2024 at 4:24 pm #16338974

Andrey
Supporter

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

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

Thank you for your feedback.

It seems that your CPT Accessories may have specific custom fields that manage the gallery in it. This could explain why manually uploading them and translating the accessories post does not copy the images.

If this is the case, you'll need to set those custom fields to "Copy" in WPML. To do this, go to WPML → Settings and scroll down to the Custom Fields Translation section.

Here are some additional details:
https://wpml.org/documentation/getting-started-guide/translating-custom-fields/#2-decide-how-to-translate-custom-fields

October 30, 2024 at 4:34 pm #16348503

vadimP

Hi, thank you for your suggestion.

The field we're having this problem with is product_image_gallery and I could not find it in the Custom Fields Translation section. (Every other field connected to galleries and product images is set to "Copy".)

To provide more context, "Accessories" post type was added via "Custom Post Type WooCommerce Integration Pro" plugin. It creates a custom post type containing the same fields that a Woocommerce product has. So the fields aren't exactly custom, even though they are inside a custom post type. Could there be a conflict with this plugin?

October 31, 2024 at 2:43 pm #16352245

Andrey
Supporter

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

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

Thank you for your feedback.

Please try the following steps:

1. Navigate to WPML → Settings → Custom Fields Translation. Activate the option "Show 'Multilingual Content Setup' meta box on the edit screen" and save your changes.

2. Go to the "Accessories" post type and edit a custom post.

3. While editing, scroll down to the bottom of the "Custom Fields" section.

4. Click on "Show system fields" to locate the related fields.

Please note that we have not yet tested this plugin for compatibility with WPML: https://wpml.org/plugin/?wpv_view_count=120064&wpv-plugin-functionality=0&wpv_post_search=Custom+Post+Type+WooCommerce+Integration+Pro&wpv-wpcf-recommendation-flag=&wpv_filter_submit=Search. As a result, compatibility issues may arise.