Home › Forums › WoodMart support forum › Woodmart and WPML string translation error
Woodmart and WPML string translation error
- This topic has 25 replies, 3 voices, and was last updated 4 years, 11 months ago by Artem Temos.
-
AuthorPosts
-
December 2, 2019 at 12:59 pm #160545
bigdropParticipantHi,
On my checkout page the shipping and payment options are not showing. There is an infinite loading icon.
Scenario 1. I disabled all plugins and kept just woocommerce, all the WPML related plugins and the woodmart theme and I get the same error.
Scenario 2. I disabled all plugins (with woodmart theme activated) and then activated them one by one. I found out that when I enable the “WPML string translation” plugin it is causing the problem.
Wooocmmerce > Status
The only warning I get is Your store is not using HTTPSWoocommerce > Woocommerce Multilingual > Status
Some prodact tags are missing translation
Some products are not yet translatedAttachments:
You must be logged in to view attached files.December 2, 2019 at 1:47 pm #160564
Artem TemosKeymasterHello,
Could you please check how it works with some default WordPress theme like twentysixteen to understand is it our theme issue or not?
Regards
December 2, 2019 at 5:07 pm #160641
bigdropParticipantI have already tested this with the Storefront theme and it works.
The error only appear when your theme is activated.
The error is there when I activate your theme, parent or child it makes no difference, so it is not some modifications that I made to child theme that causes the problem.December 3, 2019 at 7:10 am #160693
Artem TemosKeymasterOK, please, keep the Storefront theme active so we can check how it works and then we will switch to WoodMart to understand what is wrong.
December 3, 2019 at 9:14 am #160716
bigdropParticipantI have activated the storefront theme.
December 3, 2019 at 9:43 am #160724
Artem TemosKeymasterWe need your website URL as well.
December 3, 2019 at 10:27 am #160735
bigdropParticipantYes you do!
December 3, 2019 at 10:38 am #160739
Artem TemosKeymasterPlease, send us your FTP access as well. There is some issue with the theme and we need to troubleshoot it.
December 3, 2019 at 11:03 am #160751
bigdropParticipantHere it is.
Please do not make changes to the child theme.
Thank you!December 3, 2019 at 12:34 pm #160779
Artem TemosKeymasterWe don’t see anything on the server http://prntscr.com/q5jz02
December 3, 2019 at 2:13 pm #160826
bigdropParticipantPlease use these credentials
December 3, 2019 at 10:09 pm #160845
Artem TemosKeymasterThis FTP seems to be wrong now http://prntscr.com/q5mt81
December 4, 2019 at 9:34 am #160994
bigdropParticipantIt works fine for me!
https://ibb.co/PTSN3SmPlease try once more.
December 4, 2019 at 11:00 am #161011
bigdropParticipantDid it work for you?
December 4, 2019 at 11:37 am #161027
bigdropParticipantDid you fix this?
Because I do not see the error any more.December 4, 2019 at 12:47 pm #161054
Artem TemosKeymasterTry to replace the file
wp-content/themes/woodmart/inc/classes/Stylesstorage.php
with the following onehttps://drive.google.com/file/d/1zXl0QONjkn_r3MUV0wmVl6ySkl4d0r6v/view?usp=sharing
January 7, 2020 at 12:22 pm #166703
bigdropParticipantI am trying to create translations of my products. I use, as previous mentioned, the WPML plugin. I am facing a problem with the translation and I contacted the WPML support. I got the below reply.
“When I checked this out I found that the gallery should be saved on a field called woodmart_variation_gallery_data. I set this field to copy so that WPML can copy the value from this field. However, this didn’t seem to do the trick. I guess that the gallery is saved in some other way.
In this case, could you try to reach out the theme authors and ask them to have a look at this and tell you if there’s any other place (or way) that the gallery images are saved? I just want to understand how this field works so I can look for a way to make the values appear on the second language too.”
Can you please assist me on that?
Thank you
January 8, 2020 at 7:25 am #166857
Artem TemosKeymasterHello,
Yes, our products variations galleries are stored in one place only. And it is meta value with a key
woodmart_variation_gallery_data
. You can see how it is used on the frontend in the filewoodmart/inc/integrations/woocommerce/modules/variation-gallery.php
.Kind Regards
January 14, 2020 at 11:35 am #167843
bigdropParticipantHi,
I have send your answer to the WPML support and they asked me to contact you again.
“I already managed to identify that the images for the variations are saved in the woodmart_variation_gallery_data custom field. If you edit a translation of one of the products, like this one hidden link, you can see that the values of the woodmart_variation_gallery_data field (the ID of the images) are copied to the translated products.
I checked the file that the theme authors pointed out in their message. Since the IDs of the images are copied to the translated products (in which case the images should work fine on the translated product), could you ask again the theme authors if there’s anything else that needs to be done here, please?”
Since your theme is “WPML Officially Certified” as you claim can you please follow the thread that is currently open on the WPML official support?
You can find it here https://wpml.org/forums/topic/woocommerce-image-variation-swatches-not-working-in-second-language/#post-5252477I think it would be much easier this was to solve this situation.
Thank you
January 14, 2020 at 12:41 pm #167871
Artem TemosKeymasterIt seems that it works correctly as you expect. The only problem is that the field is copied exactly with images IDs and variations IDs. But your translated product has DIFFERENT variations IDs. They are not fully copied. That is why these images are not applied on your translated product. So when you create the product translation, you create NEW variations with new IDs. That is why the copied field for variations images doesn’t work.
January 15, 2020 at 4:36 pm #168151
bigdropParticipantSo, what should I do exactly?
January 16, 2020 at 7:21 am #168258
Artem TemosKeymasterI have explained why it doesn’t work but we don’t have a solution for this. You need to not copy these fields but select these images separately for translated products if possible from the WPML side.
February 10, 2020 at 9:13 am #172470
bigdropParticipantThe WPML creator fixed this issue.
You need to add this lines of code to the functions.php
// WPML FIX TRANSLATIONS add_action('wpml_after_copy_custom_field', function ($post_id_from, $post_id_to, $meta_key) { if ($meta_key == 'woodmart_variation_gallery_data') { $translated_lang = apply_filters('wpml_post_language_details', '', $post_id_to); $translated_lang = isset($translated_lang['language_code']) ? $translated_lang['language_code'] : ''; $original_value = get_post_meta($post_id_from, 'woodmart_variation_gallery_data', true); $translated_value = $original_value; if (!empty($original_value) && is_array($original_value)) { foreach ($original_value as $key => $value) { $translated_variation_id = apply_filters('wpml_object_id', $key, 'product_variation', false, $translated_lang); $translated_value[$translated_variation_id] = $value; unset($translated_value[$key]); } update_post_meta($post_id_to, 'woodmart_variation_gallery_data', $translated_value); } } }, 10, 3);
February 10, 2020 at 9:22 am #172471
Artem TemosKeymasterThank you. We are talking to WPML team now to discuss the details.
February 18, 2020 at 9:18 am #174206
chicshopParticipantI am facing this same issue with your theme described by bigdrop in post #166703 related to the woodmart_variation_gallery_data field not copied in the WPML translations of the products.
Could you advise on how to apply the fix (for existing translated products)he has received from WPML in post #172470 above
I have tried adding the code to functions.php and the woodmart_variation_gallery_data field is also set to copy in WPML settings, but existing products are not affected.
Looking for a solution as we have thousands of already translated products which is missing woodmart_variation_gallery_data fields from the original.
Thanks
February 18, 2020 at 11:24 am #174209
Artem TemosKeymasterHello @chicshop,
The solution from the WPML team works when you copy the field and if you want to have some more general solution, try to contact their team for help.
That particular fix will be included in our next theme update so newly created products will work correctly.Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register