Home Forums WoodMart – Premium Template Woodmart and WPML string translation error

This topic contains 25 replies, has 3 voices, and was last updated by Artem Temos Artem Temos 3 months, 2 weeks ago.

Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #160545

    bigdrop
    Customer

    Hi,

    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 HTTPS

    Woocommerce > Woocommerce Multilingual > Status
    Some prodact tags are missing translation
    Some products are not yet translated

    Private Content Hidden
    • This topic was modified 6 months ago by  bigdrop.
    Attachments:
    You must be logged in to view attached files.
    #160564

    Hello,

    Could you please check how it works with some default WordPress theme like twentysixteen to understand is it our theme issue or not?

    Regards

    #160641

    bigdrop
    Customer

    I 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.

    #160693

    OK, 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.

    #160716

    bigdrop
    Customer

    I have activated the storefront theme.

    Private Content Hidden
    #160724

    We need your website URL as well.

    #160735

    bigdrop
    Customer

    Yes you do!

    Private Content Hidden
    #160739

    Please, send us your FTP access as well. There is some issue with the theme and we need to troubleshoot it.

    #160751

    bigdrop
    Customer

    Here it is.

    Please do not make changes to the child theme.
    Thank you!

    Private Content Hidden
    #160779

    We don’t see anything on the server http://prntscr.com/q5jz02

    #160826

    bigdrop
    Customer

    Please use these credentials

    Private Content Hidden
    #160845

    This FTP seems to be wrong now http://prntscr.com/q5mt81

    #160994

    bigdrop
    Customer

    It works fine for me!
    https://ibb.co/PTSN3Sm

    Please try once more.

    Private Content Hidden
    #161011

    bigdrop
    Customer

    Did it work for you?

    #161027

    bigdrop
    Customer

    Did you fix this?
    Because I do not see the error any more.

    #161054

    Try to replace the file wp-content/themes/woodmart/inc/classes/Stylesstorage.php with the following one

    https://drive.google.com/file/d/1zXl0QONjkn_r3MUV0wmVl6ySkl4d0r6v/view?usp=sharing

    #166703

    bigdrop
    Customer

    I 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

    Private Content Hidden
    #166857

    Hello,

    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 file woodmart/inc/integrations/woocommerce/modules/variation-gallery.php.

    Kind Regards

    #167843

    bigdrop
    Customer

    Hi,

    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-5252477

    I think it would be much easier this was to solve this situation.

    Thank you

    #167871

    It 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.

    #168151

    bigdrop
    Customer

    So, what should I do exactly?

    #168258

    I 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.

    #172470

    bigdrop
    Customer

    The 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);
    #172471

    Thank you. We are talking to WPML team now to discuss the details.

    #174206

    chicshop
    Customer

    I 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

    #174209

    Hello @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

Viewing 26 posts - 1 through 26 (of 26 total)

You must be logged in to reply to this topic.