• Resolved one3rdnerd

    (@one3rdnerd)


    Hello,

    Firstly I know Gutenberg isn’t officially supported by WooCommerce yet but I found an issue with a popular snippet that pretty much makes it work perfectly.

    The code below turns the block editor and pretty much everything works apart from when the block editor is active you can no longer turn the reviews on or off under Product Data > Advanced. You can check and uncheck it and save but if you refresh the edit product screen the saves don’t take.

    // 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 );

    I have tested the other checkboxes like virtual and downloadable and they work, I have also made changes to price and other data sets in the product data box and not seen any issues when saving. It appears to only happen for this one enable reviews checkbox.

    I have also replicated this on a second website to confirm it wasn’t something else.

    Any ideas what’s different about this field that could be causing it not to save?

    I’d appreciate your input. Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @one3rdnerd!

    Thanks for sharing it with everybody! I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    Since this requires custom coding, we recommend getting in touch with one of the customization experts listed on the WooCommerce Customizations Page.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.`

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    I hope this helps!

    Thread Starter one3rdnerd

    (@one3rdnerd)

    @judagutor

    Thanks for your reply.

    I’m confused that if WooCommerce is owned by WordPress and WordPress is trying hard to retire the classic editor soon why this wasn’t a priority 2 years ago.

    Are the WooCommerce devs even actively working on this? Strange they would focus their efforts on building WooCommerce blocks that can be added to pages and posts while ignoring this feature on their own post type (Products).

    You can do amazing things when you can turn on Gutenberg at the product level and create product pages that compete with some of the best looking eCommerce sites out there. Sadly without this feature WooCommerce product pages are pretty basic.

    I’d love to know if this is a priority area for WooCommerce devs to address sometime soon.

    I have spoken with a few developers who have basically just said, it’s probably best to wait until WooCommerce supports this and they aren’t interested in solving it.

    I appreciate your input.

    Mirko P.

    (@rainfallnixfig)

    Hello @one3rdnerd

    Thanks for sharing your thoughts.

    Please know that developers have been working on enabling Gutenberg for product editing for some time now, the work is still ongoing and there is not a defined date.

    There are many aspects to be taken into consideration and this article walks through some of those: https://woocommerce.com/posts/woocommerce-gutenberg/.

    You may want to try another snippet that has been posted on the WooCommerce Github repository:

    https://github.com/woocommerce/woocommerce/issues/28419#issuecomment-945430144

    We do not provide support for third-party plugins or custom code and we can’t guarantee it will work. Use the snippet at your own risk and take a full backup before making any changes.

    If you need help with further customization, we’d recommend hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Thanks.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    @rainfallnixfig

    Thanks for your message.

    The code on that link is the code I used. I am one of the people commenting on the thread you linked to.

    I have asked a number of other developers but so far nobody is willing to take it on. The WooCommerce slack has never been very fruitful in my experience. More just people asking questions.

    Hopefully, this feature is added and working soon.

    I will read through the blog and see if I can work things out.

    Mirko P.

    (@rainfallnixfig)

    Hi @one3rdnerd,

    Indeed, we also hope Gutenberg-compatible screens for Products/Orders/etc. will be developed soon within the next WooCommerce core plugin releases.

    Any related updates will be anticipated on our WooCommerce Developer Resources.

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

    Cheers.

    Thread Starter one3rdnerd

    (@one3rdnerd)

    Hi @rainfallnixfig

    Okay, glad to hear it, though my requirements are much simpler than that I think.

    All I want is the ability to use the Gutenberg editor for the product description, nothing more than that. I don’t want to build the page in Gutenberg as I use BeaverBuilder for my templates, I just want to allow clients to have more control over the product description to make it more jazzy.

    That works already with the code above aside from the one bug with the reviews toggle under product data>advanced.

    I think turning this feature on would be a good baby step towards the end goal of total control over the product page though I’m unlikely to ever want to give clients access to that.

    I appreciate your input. I will monitor the developer page for news on this and for now I will continue trying to find a developer willing to try and fix this reviews issue.

    Mirko P.

    (@rainfallnixfig)

    I will monitor the developer page for news on this

    Thanks for getting back. Sounds good!

    Since the thread is now closed you may want to open a new topic if you have any more questions.

    Have a great day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Gutenberg custom code and reviews’ is closed to new replies.