Archived topic
Woo Single Product, Product Description blocks
5 replies · Started by troyw on January 24, 2023
Hey guys,
I have GP Premium and Generateblocks Pro and I am trying to create a section in the single product description with two Columns, so that I can have a Video on the left and a button on the right (or vis versa). I was expecting to see the block editor or something in the Single Product backend, but there are no tools to enable me to simply add the 2 columns, as I would in a page or a post.
I found this post #2466284, but I can see no GB Buttons on my Product editor?
How can I do this?
Hi Troyw,
I found this article which may be helpful for you and what you're trying to do: https://docs.wpstackable.com/article/485-how-to-use-the-block-editor-in-woocommerce-product-pages
This article basically shows how to change the editor of WooCommerce Product edit pages to the Block Editor.
Thanks so much Fernando.
I tried adding this to the Functions PHP file in the child theme but it errors?
Try this:
// enable gutenberg for woocommerce
function 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', 'activate_gutenberg_product', 10, 2 );
// enable taxonomy fields for woocommerce with gutenberg on
function enable_taxonomy_rest( $args ) {
$args['show_in_rest'] = true;
return $args;
}
add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
Sorry, yes, just removed the <br> at bottom and now it works. Cheers
Cheers!