Home Forums WoodMart support forum Assistance Needed with Translation Issue on Single Product Layout

Assistance Needed with Translation Issue on Single Product Layout

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #605560

    Dave
    Participant

    Dear Woodmart Support Team,

    I am encountering an issue with my website related to the translation of a Single Product Layout. After completing a translation to 100% using WPML, the translation status does not update, and the gear icon remains instead of showing completion. Furthermore, I am unable to edit the French and German translations of the layout. When I try to make these translations independent from the original English version and edit them, I encounter a critical error:

    “There has been a critical error on your website. Please check your site admin email inbox for instructions.”

    WPML Support provided the following information to me:

    In the ATE error logs, we were able to locate this error:
    Call to a member function get_gallery_image_ids() on null /home/u160632271/domains/gisoojewels.ch/public_html/wp-content/themes/woodmart/woocommerce/single-product/product-image.php:27
    This points to a known issue with Woodmart and Product layouts, which is documented here:
    Woodmart Fatal Error When Translating Product Layouts
    Please contact Woodmart support and provide them with this error. Their team should know how to resolve it, as the issue resides in their code. We had another client who resolved this issue with Woodmart’s help.

    Could you please assist me in resolving this issue with the translation status and critical error? Any guidance from your team would be greatly appreciated.

    Thank you in advance for your support. I look forward to your assistance.

    Best regards,
    Dave

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

    Luke Nielsen
    Keymaster

    Hello,

    Navigate to Theme Settings -> Single product -> assign the relevant product here – https://take.ms/MTV6m

    Clear the cache and recheck the issue.

    Kind Regards

    #605743

    Dave
    Participant

    Dear Luke,

    Thank you for your response. I followed your instructions. However, after clearing the cache, the issue persists. The translation status still does not update to 100%, and the gear icon remains active.

    Could you please advise on the next steps to resolve this?

    Thank you for your help.

    Best regards,
    Dave

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

    Luke Nielsen
    Keymaster

    Hello,

    Does it happen only in Layouts or with pages too?

    Thank you for your patience.

    Kind Regards

    #605748

    Dave
    Participant

    Hi,

    I just tested this with a new page in the Pages, and the same issue persists—translation status does not update, and the gear icon remains. Please see the attached screenshot.

    Thank you for your help.

    Best regards,
    Dave

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

    Luke Nielsen
    Keymaster

    Hello,

    Okay, in this case, could you please check how it works on the default WooCommerce Storefront theme?

    Looking forward to collaborating with you!

    Kind Regards

    #605847

    Dave
    Participant

    Hi Luke,

    Before switching to the WooCommerce Storefront theme, I checked the pages again, and after several hours, the test page showed the correct translation status (pencil icon) (Screenshot 1). However, there was still no progress with the layout (Screenshot 2).

    When I switched to WooCommerce Storefront, the layout issue was resolved (Screenshot 3). But after returning to Woodmart and making some translation changes, the gear icons reappeared (Screenshot 2 again).

    Looking forward to your guidance on how to proceed.

    Best regards,
    Dave

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

    Luke Nielsen
    Keymaster

    Hello,

    I apologize for the delay.

    May I disable some 3rd party plugins for testing?

    Thank you in advance.

    Kind Regards

    #606461

    Dave
    Participant

    Dear Luke,

    Yes. I have a fresh backup in place.

    Thank you for your help.

    Best regards,
    Dave

    #606974

    Luke Nielsen
    Keymaster

    Hello,

    Add the below code to the fucntions.php file in your child theme:

    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) ;
    	}
    } );

    Clear the cache and recheck the issue.

    Kind Regards

    #607061

    Dave
    Participant

    Dear Luke,

    Thank you for the provided solution. I implemented the code, and I’m happy to report that it has fixed the problem with the translation status, both for the layouts and the pages.

    I appreciate your support in resolving this issue!

    Best regards,
    Dave

    #607062

    Luke Nielsen
    Keymaster

    Hello,

    You are welcome. Always remember that you can reach out to us with any questions you may have.

    Have a good day!

    Kind Regards

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

The topic ‘Assistance Needed with Translation Issue on Single Product Layout’ is closed to new replies.