Home Forums WoodMart support forum WMPL can not translate woodmart single product layout

WMPL can not translate woodmart single product layout

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #583082

    ipaybom
    Participant

    My WMPL always gets stuck when translating single product layout files.

    Attachments:
    You must be logged in to view attached files.
    #583230

    ipaybom
    Participant

    I have queried the log ,it is because of a control error in a single layout file, very similar to the following case, please let me know how to fix it, thanks!

    https://xtemos.com/forums/topic/single-product-layout-stuck-in-translation-wpml/

    Attachments:
    You must be logged in to view attached files.
    #583233

    ipaybom
    Participant

    1. When I use the control: frequently bought together
    This control causes WMPL to get stuck and keep trying to translate but it doesn’t complete properly.

    2. I’ve tested that when Product gallery uses “inherit from theme Settings”, it also causes WMPL to get stuck and not translate properly.

    Attachments:
    You must be logged in to view attached files.
    #583283

    Artem Temos
    Keymaster

    Hello,

    Please disable any plugins not directly related to our theme and provide us with your admin access details. We will log in to your dashboard and investigate the issue. Please ensure that you only keep the following plugins that are necessary for our theme to work correctly:
    – WoodMart core
    – WooCommerce
    – Elementor/WPBakery Page Builder

    Thank you in advance.

    #583296

    ipaybom
    Participant

    Extra information

    #583441

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    add_action(
    	'woocommerce_before_template_part',
    	function () {
    		global $product;
    
    		if ( wp_is_json_request() && ! $product ) {
    			$random_product = new WP_Query(
    				array(
    					'posts_per_page' => '1',
    					'post_type'      => 'product',
    				)
    			);
    
    			while ( $random_product->have_posts() ) {
    				$random_product->the_post();
    				$product_id = get_the_ID();
    			}
    
    			wp_reset_postdata();
    
    			$product = wc_get_product( $product_id );
    		}
    	}
    );
    #583451

    ipaybom
    Participant

    After using this code, the translation works, but “Frequently bought together” is not displayed properly in other languages.

    #583630

    Artem Temos
    Keymaster

    You need to allow “FBT” translation first https://monosnap.com/file/ggF3rvIA2YZ3qv8zmEqqYiT1axISRw
    Then you need to create these translations.

    #583668

    ipaybom
    Participant

    After my tests, it still doesn’t show up. Even after clearing the cache with wp -rocket, it doesn’t display correctly in other languages.

    #583706

    Artem Temos
    Keymaster

    We have created a test translation (https://monosnap.com/file/XM5eGXaefiOCh8qPYfRGctmbPuRxtP), connected it to the product’s translation (https://monosnap.com/file/eptpjUqgkVO6HnSK2YAGz295Fq0KUd) and now it works correctly (https://monosnap.com/file/iojD3KLagCwobaPRJnA95OZtSOShtd)

    Please test it from your end.

    #583710

    ipaybom
    Participant

    Please note the contents of the attached document.

    #583739

    Artem Temos
    Keymaster

    Try to do the following instead.

    1 – Disable translations for Frequently Bought Together
    https://monosnap.com/file/GaMGi96C2RN3n1FHzlXtaZeeOQGTpP

    2 – Enable copy translation of custom fields for woodmart_fbt_bundles_id https://monosnap.com/file/kOMplso0o4w9bKOrbJMql0uQqqp3iV

    3 – Save the product translations again
    https://monosnap.com/file/l9TMeR0U85LnDLUV7VjLyG1ud6lW7x

    #583740

    ipaybom
    Participant

    Thank you very much for your help, it works fine, thank you, very professional.

    #583847

    Artem Temos
    Keymaster

    You are always welcome. Feel free to contact us if you have any further questions.

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

The topic ‘WMPL can not translate woodmart single product layout’ is closed to new replies.