Redirect vendor to a custom page after registration
The Multi Vendor plugin use the standard WooCommerce registration form so, after registration, a vendor will redirect to My Account page. If you want to redirect it in a custom page you can use this snippet of code:
add_filter( 'yith_wcmv_after_become_a_vendor_redirect_uri', 'yith_wcmv_after_become_a_vendor_redirect_uri' );
add_filter( 'woocommerce_registration_redirect', 'yith_wcmv_after_become_a_vendor_redirect_uri' );
if( ! function_exists( 'yith_wcmv_after_become_a_vendor_redirect_uri' ) ){
function yith_wcmv_after_become_a_vendor_redirect_uri( $redirect_url ){
if( function_exists( 'yith_get_vendor' ) ){
$vendor = yith_get_vendor( 'current', 'user' );
if( $vendor->is_valid() ){
$redirect_url = 'https://www.google.com';
}
}
return $redirect_url;
}
}
Please, copy this code and past it at the end of functions.php file. This code redirect the vendor to https://www.google.com, replace this value with your custom url.
WooCommerce use the
wp_validate_redirect()
function for redirect url so If you want to use an extenal url you must add it in whitelist. You can use the hook
allowed_redirect_hosts
documented in wp-includes/pluggable.php: at line 448For more details, please visit: https://developer.wordpress.org/reference/hooks/allowed_redirect_hosts/