Woocommerce Redirect
-
Hi
I have add in fonction.php this
add_filter(‘woocommerce_login_redirect’, ‘ras_login_redirect’);
function ras_login_redirect( $redirect_to ) {
global $current_user, $wpdb;
$role = $wpdb->prefix . ‘capabilities’;
$current_user->role = array_keys($current_user->$role);
$role = $current_user->role[0];if($role==”adminsitrator”){
$redirect_to = ‘https://anypage.com’;
return $redirect_to;
}else{
$redirect_to = ‘https://anotherpage.com’;
return $redirect_to;
}
}But it s look like it can t take the current user role
Any Idea ?
Regards
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Woocommerce Redirect’ is closed to new replies.