Skip Navigation

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.

This topic contains 3 replies, has 2 voices.

Last updated by xavierC-7 1 year, 8 months ago.

Assisted by: Kor.

Author Posts
July 21, 2023 at 8:49 am #14077139

xavierC-7

I created 75 product categories in woocommerce (default product_cat, not custom tax), in wpml settings, the 'thumbnail_id' is set to 'copy', I translated all product categories in secondary language, but the product category thumbnail is not copied to the translation, I get the default woocommerce thumbnail png instead.
What did I do wrong ?
Thank you

July 21, 2023 at 3:16 pm #14080961

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for contacting WPML support.

Please try running the Sync options in Woocommerce > WooCommerce Multilingual & Multicurrency > Status > Troubleshooting. Before you do that, please perform a full backup.

If this doesn't work, navigate to WPML > Settings > Media Translation > Click Start to sync

Let me know how it goes.

July 24, 2023 at 1:28 pm #14089841

xavierC-7

Thanks, my issue is now resolved, it works as intended. As usual, great support !

July 24, 2023 at 1:38 pm #14089901

xavierC-7

Oh I spoke a bit fast, in the back-office, all images are synced which is great, but when I call an image, for example like this :

$thumbnail_id = get_term_meta( $card_product_cat->term_id, 'thumbnail_id', true );     
$image_attributes = wp_get_attachment_image_src($thumbnail_id, 'product-swiper');
$image_attributes_hd = wp_get_attachment_image_src($thumbnail_id, 'product-swiper-hd');

And this is the custom image size in functions.php :

add_image_size( 'product-swiper', 440, 535, true );
add_image_size( 'product-swiper-hd', 880, 1070, true );

The main language returns the good resolution, but the secondary language looks for a 425*535 and 850*1070 file, so it returns a 404.
The resolution of add_image_size might have been 425*880 some time ago before I changed it recently, and all thumbnails have been regenerated (regenarate thumbnails).
What could be pulling this resolution and generating this issue?
And as I understood, I don't need wpml_media because I want to always use the same images in all languages. Am I wrong?

July 24, 2023 at 2:16 pm #14090339

xavierC-7

My issue is resolved, I just had to open every product_cat in the secondary language and save them again.