Hi. How can we help?

Redirect vendor to the vendor store page after login

If you want redirect vendor to the venodr store page after login you could with this provided code.

Insert this in  functions.php in your theme:

 

if ( ! function_exists( 'yith_wcmv_login_redirect' ) ) {
function yith_wcmv_login_redirect( $redirect_to, $request, $user ) {
if( function_exists( 'yith_get_vendor' ) ){
$vendor = yith_get_vendor( 'current', 'user' );
if( $vendor->is_valid() ){
$redirect_to = $vendor->get_url( 'frontend' );
}
}

return $redirect_to;
}
}
add_filter( 'login_redirect', 'yith_wcmv_login_redirect', 10, 3 );
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >