Site logo

[Resolved] generate blocks woocommerce integration?

Home Forums Support [Resolved] generate blocks woocommerce integration?

Home Forums Support generate blocks woocommerce integration?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1202172
    johnaps

    Hello!
    I am currently trying out generateblocks! Gudos on the release, always happy for your developments in any kind of plugin!
    I just want to ask cause i have an ecommerce store (woocommerce)
    Can i use it on product pages? Like lets say elementor lets you costumize the body of product pages just as you want…? is there a way to do this? It would be superawesome i think!!

    #1204456
    David
    Staff
    Customer Support

    Hi there,

    not yet there isn’t. Maybe something for the future 😉

    #1205612
    johnaps

    Would be great! Maybe a workaround would be to make gutenberg take control of woocommerce product pages? Will look into it…

    #1206067
    David
    Staff
    Customer Support

    You can enable the Gutenberg editor on Single Products like so:

    // WP 5.0 Woo 3.4.1 or later
    // Edit Woo Product with Gutenberg
    function db_enable_gutenberg_single_product($editable, $post_type) {
    	if($post_type == 'product'){
    		$editable = true;
    	}
    	
    	return $editable;
    }
    add_filter('use_block_editor_for_post_type', 'db_enable_gutenberg_single_product', 10, 2);

    But this will only allow you to edit the Short Description.

    I would expect Woo has full product editing in its future scope.

    #1206549
    johnaps

    Found this and i am trying it out, leaving it here for other fellow happy generatepressors!~ (looks complete at first glance…)

    function wplook_activate_gutenberg_products($can_edit, $post_type){
    	if($post_type == 'product'){
    		$can_edit = true;
    	}
    	
    	return $can_edit;
    }
    add_filter('use_block_editor_for_post_type', 'wplook_activate_gutenberg_products', 10, 2);
    #1206586
    Leo
    Staff
    Customer Support

    Thanks for sharing 🙂

    #1569864
    melvin

    Hi Johnnaps,

    I’ve enabled gutenberg in Product by using the code below,

    function wplook_activate_gutenberg_products($can_edit, $post_type){
    	if($post_type == 'product'){
    		$can_edit = true;
    	}
    	
    	return $can_edit;
    }
    add_filter('use_block_editor_for_post_type', 'wplook_activate_gutenberg_products', 10, 2);

    Everything work well except the “Product Category” & “Product Tag” are missing at the at the product back end for editorial.

    https://imgur.com/a/zDLDOJW

    Do you have the similar problem and any solution have you tried to make the “product category” and “product tag” appear?

    Notes: Im able to configure out the Rankmath, Reviews, and other fields. But only unable to configure the “Product Category” & “Product Tag”

    Thanks

    #1570003
    johnaps

    I think you can edit them from quick edit on “all products”

    #1570013
    melvin

    Hi johnaps,

    Thanks for your response. I appreciate it very much.

    TQ and have a nice day

    Regards,
    Melvin

    #2400881
    Bartosz

    I experienced a bug where the classic editor was still loading instead and wanted to share an updated solution:

    • Changed add_filter $priority from default (10) to a value of 20
    • Added taxonomy for WooCommerce category and tags

    // Enable Gutenberg Blocks in Product Descriptions
    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', 20, 2 );
    
    // Show taxonomy for woocommerce category and tags
    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' );
    #2401797
    Leo
    Staff
    Customer Support

    Thanks for sharing!

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.