NO BUG: Woo Product content: <p></p> around block editor <!--- wp: Markup -->?

Hello,
Has anyone else seen this issue? Bricks 1.8.3 (never tried earlier) and latest WooCommerce, latest WordPress. I noticed that Bricks was adding <p> </p> around all the Gutenberg / Block Editor markup, wreaking havoc with my layout. This is when using a Bricks Template with the “Product Content” component within a few blocks. When I removed that and used “Post Content” instead, the problem has gone away. I assume there’s a difference between these, but post content works fine for me.

Here is a screenshot of the html source when the problem is present. Very strange. Disappears obviously, when I have bricks disabled, or when I use the “post content” thingy in bricks editor instead.

Using post content is fine for me, so this can be closed if a non-issue, but figured you may want to know. Thanks for the great elementor alternative / improvement!!

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: (sorry, since fixed, see screenshot)

Hi Simon,
Thanks so much for your report!

The product content element outputs the rich text content of the product description (rich text editor, see screenshot). Your screenshot confuses me because you are outputting Gutenberg content that doesn’t exist on a product (by default). Can you provide me a live link so I can understand the setup?

Best regards,
timmse

Oh I know why its happening now. I’d manually activated Gutenberg for products since I wish to use that editor as my ‘product details’ are lengthy. Since this isn’t a common situation, the use case hasn’t been designed for in Bricks.

I don’t have a page setup like this anymore (i’m just using post_content which works fine) but suspect this explains why it happened, and how it could be made compatible.

Here’s how its enabled if you wish to test scenario.

// // Disable new WooCommerce product template (from Version 7.7.0)
function restored_reset_product_template($post_type_args) {
if (array_key_exists(‘template’, $post_type_args)) {
unset($post_type_args[‘template’]);
}
return $post_type_args;
}
add_filter(‘woocommerce_register_post_type_product’, ‘restored_reset_product_template’);

// Enable Gutenberg editor for WooCommerce
function restored_activate_gutenberg_product($can_edit, $post_type) {
if ($post_type == ‘product’) {
$can_edit = true;
}
return $can_edit;
}
add_filter(‘use_block_editor_for_post_type’, ‘restored_activate_gutenberg_product’, 10, 2);

Hey Simon,
Thanks for the feedback. That’s what I was thinking


Gutenberg is not used by default in WooCommerce, so there is no reason to customize the product content element. If the post content element works in that case, it’s a more than workable “workaround”.