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)
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?
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â.