This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was unable to translate the Single Product Layout using WPML as it would freeze and changes could not be saved. Other layouts were translating without issues.
Solution:
We identified that this issue was related to a known problem with the WoodMart theme, which has been documented here: WoodMart Fatal Error When Translating Product Layouts.
To resolve this, we recommended adding the following code to the functions.php file of the client's child theme and clearing the caches:
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 ); } } );
We advised the client to try translating the Product Layout again to ensure it works as expected.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.
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 is split from https://wpml.org/forums/topic/product-is-showing-a-blank-screen/
This topic contains 5 replies, has 0 voices.
Last updated by 1 month, 1 week ago.
Assisted by: Bigul.