Trying to enable Gutenberg editor for products page in WordPress WooCommerce. However it breaks the reviews section on product page and when I click on "Add Comment" nothing happens.
This is the code I use to enable Gutenberg.
function activate_gutenberg_product($can_edit, $post_type) {
if ($post_type === 'product') {
$can_edit = true; // Enable the block editor for products
}
return $can_edit;
}
add_filter('use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2);
What might cause this?
After investigating it I feel like it's best way to create custom logic to it instead of enabling Gutenberg inside WC product edit page.
Maybe something with custom post type where post gets created with desired content and that post has some option to attach it to desired products which should show that Gutenberg content.
Anyways this is what I came up with, however I am open for other ideas.