0

Via a php snippet I have enabled Gutenberg for Woocommerce. Works perfect but sometimes when I want edit product, I get a white screen on some product pages. Any idea how this happen? (Could be a JS conflict?) I'm not sure or there is a better way to enable the Gutenberg editor for Woocommerce or this a little bit unstable tweak.

WP vers: 5.8.2

PHP ver: 7.4.26

   if($post_type == 'product'){
       $can_edit = true;
   }
   
   return $can_edit;
}
add_filter('use_block_editor_for_post_type', 'wplook_activate_gutenberg_products', 10, 2);```
2
  • Third party plugins are off topic here, so I would ask this in the WooCommerce support forum. That being said, if it's not enabled by default then it's likely for a reason. Commented Dec 1, 2021 at 8:41
  • For those who found it because they want to enabe the Gutenberg editor for WooCommerce product without coding: wordpress.org/plugins/blocks-product-editor-for-woocommerce
    – olegabr
    Commented Jul 7, 2022 at 2:19

1 Answer 1

0

Open developer tools in the browser and check for errors in console. To better understand the errors, set define(SCRIPT_DEBUG, true) in your wp-config.php. Remember to turn this option off when done with debugging, because it uses dev version of React and slows down page. Install React Developers Tools and Redux DevTools (if needed) - available for Chrome & Firefox, possibly for other browsers as well, for thorough debugging.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.