Blog Archives

How to Remove Reviews Tab in WooCommerce Product Page

Via:MyTutorialGuru.com

In one of our recent online shopping project, client request us to disable the reviews tab from the product details page. You might also want the same result, that’s why you landed on this page. Here is the solution. Just add the following code in your theme’s functions.php file and that’s all.

add_filter( ‘woocommerce_product_tabs’, ‘wcs_woo_remove_reviews_tab’, 98 );
function wcs_woo_remove_reviews_tab($tabs)
unset($tabs[‘reviews’]);
return $tabs;

Easily Redirect WooCommerce User After Login

Via:MyTutorialGuru.com

In WooCommerce shop by default user is been redirected to my account page after they login to their account. but you can easily change this by adding a simple function in your theme function. We have done this recently for one of our cients. Lets see the code snippet.

Following code snippet will redirect your customer to shop page after they login. Add this in your themes functions.php

add_filter('woocommerce_login_redirect', 'ras_login_redirect');
function ras_login_redirect( $redirect_to )
$redirect_to = 'http://www.example.com/shop/';
return $redirect_to;

We have added a static URL. If you want dynamic home URL then add code as follows:

add_filter('woocommerce_login_redirect', 'ras_login_redirect');
function ras_login_redirect( $redirect_to )
$redirect_to = home_url()."/shop/";
return $redirect_to;

You can practically redirect to any URL you want. For example you might want them to redirect them to home page then add the following code:

add_filter('woocommerce_login_redirect', 'ras_login_redirect');
function ras_login_redirect( $redirect_to )
$redirect_to = home_url();
return $redirect_to;

Or you can use unique page ID rather than static URL. Get the page ID from admin and use as follows:

add_filter('woocommerce_login_redirect', 'ras_login_redirect');
function ras_login_redirect( $redirect_to )
$redirect_to = get_permalink( 1066 );
return $redirect_to;

If you have a private shop and want only registered user have access to the shop then you might want to keep the shop page private and force them to login. See How to redirect WooCommerce User to Login Page.