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, $user ) {
if( function_exists( 'yith_get_vendor' ) ){
$vendor = yith_get_vendor( $user, 'user' );
if( $vendor->is_valid() ){
$redirect_to = $vendor->get_url( 'frontend' );
}
}
return $redirect_to;
}
}
add_filter( 'woocommerce_login_redirect', 'yith_wcmv_login_redirect', 10, 2 );