This topic has 26 replies, 3 voices, and was last updated 1 years, 9 months ago ago by Rose Tyler
Hello,
Thank you. I passed your reply to WPML developers.
Regards
Hello,
We got an answer from WPML company and found the solution for your case
We added few lines code in Dashboard -> Snippets -> WPML fix content-product fatal error (snippet)
Code below:
add_action('woocommerce_before_template_part', function ($template_name) {
if ( $template_name == 'loop/loop-start.php') {
remove_all_filters('the_content');
}
}, 10, 1);
Now if that snippet is enabled no fatal errors are shown on frontend
https://prnt.sc/DPjQ-R8NcnxR
Regards
Thanks for your help, yes it is fixed on the homepage now. But my other pages are not loading correctly. like URL given in the private contents area.
I think all pages not loading properly where WooCommerce products are shown using shortcode.
Yes, you are right
We improved our code on your staging site
add_action('woocommerce_before_template_part', function ($template_name) {
if ( $template_name == 'loop/loop-start.php' || $template_name == 'loop/sale-flash.php') {
remove_all_filters('the_content');
}
}, 10, 1);
Regards
seems like it is fixed, can you please tell me what this code doing exactly so that I will note it.
Hello,
1/ after we contacted WPML plugin they answered that they add some filters to the_content function
2/ Our products show the_content in some cases
3/ This code will remove all filters from ‘the_content’ (included the WPML one) just before content of product was loaded (or woocommerce products loop started )
Regards
Tagged: fatal error, template, troubleshooting, woocommerce, wordpress, wpml
The issue related to '‘Getting Fatal error with WPML one feture’' has been successfully resolved, and the topic is now closed for further responses