Viewing 11 replies - 1 through 11 (of 11 total)
  • I’d like to know this too!

    something I would like to do as well

    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.

    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

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

    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

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

    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

    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?

    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)

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WooCommerce – eCommerce plugin for WordPress] Disable the reviews tab’ is closed to new replies.