WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] [Plugin: WooCommerce - eCommerce plugin for WordPress] Disable the reviews tab (12 posts)

  1. ellebillias
    Member
    Posted 2 years ago #

    How do you disable the reviews tab?

    http://wordpress.org/extend/plugins/woocommerce/

  2. haije
    Member
    Posted 2 years ago #

    I'd like to know this too!

  3. MC
    Member
    Posted 2 years ago #

    something I would like to do as well

  4. haije
    Member
    Posted 2 years ago #

    Hi, I found out how to do it, it was amazingly easy:

    just disable the comments from the product page, the comment function is used for the reviews.

  5. Sean Barton
    Member
    Posted 2 years ago #

    Or for an alternative approach just add this to the top of your functions.php theme file:

    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

    thanks
    Sean

  6. jrgd
    Member
    Posted 2 years ago #

    seanbarton: awesome! thanks!
    btw would you know where to get documentation on all the hooks and filters in woo?

  7. Sean Barton
    Member
    Posted 2 years ago #

    Hi jrgd,

    You're welcome. No sorry I don't really have that info but I tend to just Google around for things and then look at the code myself. The Woo guys are pretty neat coders so digging into their work isn't so painful.

    Just look at the entire plugin for the strings 'apply_filters' and 'do_action'. That will give you a list of all of the things you can hook onto.

    I am slowly putting interesting things I find onto my blog about it but certainly going to the woocommerce site and looking at their support/documentation sections is going to yield more fruit.

    That is to say unless you have a specific requirement.. something to add to or remove in which case I can probably help you directly.

    thanks
    Sean

  8. pshao
    Member
    Posted 1 year ago #

    Is there a way to keep the product reviews, but force reviewers to log in before commenting?

  9. Sean Barton
    Member
    Posted 1 year ago #

    Hi pshao,

    Yes there is. You would need to remove the option as mentioned above but only the panel...

    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

    Then you would need to write a function which worked as an intermediary:

    add_action( 'woocommerce_product_tab_panels', 'sb_woocommerce_product_reviews_panel', 30);
    
    function sb_woocommerce_product_reviews_panel() {
        global $current_user;
    
        if ($current_user->ID) {
            woocommerce_product_reviews_panel();
        } else {
            echo '<p>You need to login first</p>';
            wp_login_form();
        }
    }

    thanks
    Sean

  10. ehong33234
    Member
    Posted 1 year ago #

    It would be great to be able to move the reviews to it's own page and use it almost as Testimonials. Could it be done by creating a Page and using short-code perhaps?

    I don't know PHP or CSS. Anyone have a solution?

  11. jorijnsmit
    Member
    Posted 1 year ago #

    For some reason disabling the reviews tab also disables my review panel...

    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
    //remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30 );

    This is interesting because the other way around it works as expected; disabling the panel doesn't display the tab:

    //remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30 );

    Am I missing something? Note: I want to display ONLY the reviews themselves, so I also disabled the attributes and description tab:

    // remove product attributes tab
    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20 );
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_attributes_panel', 20 );
    
    // remove product description tab
    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10 );
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_description_panel', 10 );

    (Credits go to from http://www.wpflexishop.com/snippet-tag/woocommerce/ for getting me so far)

  12. jorijnsmit
    Member
    Posted 1 year ago #

    Edit: I was able to hide the tab now by adding this to the bottom of woocommerce.css:

    .woocommerce_tabs .tabs {
    	display: none;
    }

    Although probably not the neatest solution it does do the trick.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic