Hello @flo1982 ,
We have used the default WooCommerce filter woocommerce_registration_redirect to redirect after the vendor completes registration.
You can override this if you need it. You can find this function definition here – dokan-lite/includes/Vendor/SetupWizard.php see function filter_woocommerce_registration_redirect.
Thank you 🙂
Hello,
I tried to redirect the vendors to teh page “haendler-registrierung-erfolgreich” (page ID 704) with the following code:
add_filter( ‘woocommerce_registration_redirect’, ‘custom_woocommerce_registration_redirect’, 11, 1 );
function custom_woocommerce_registration_redirect( $var ) {
$url = $var;
$user = wp_get_current_user();
if ( in_array( ‘seller’, $user->roles ) ) {
$url = dokan_get_navigation_url(‘haendler-registrierung-erfolgreich’);
}
return $url;
}
But it did not work. Do you have an idea how can I change the direction ?
Hello @flo1982 ,
I have used the same code and only changed the navigation URL slug to match one of the dashboard slug and it worked perfectly.
add_filter( 'woocommerce_registration_redirect', 'custom_woocommerce_registration_redirect', 11, 1 );
function custom_woocommerce_registration_redirect( $var ) {
$url = $var;
$user = wp_get_current_user();
if ( in_array( 'seller', $user->roles ) ) {
$url = dokan_get_navigation_url('reviews');
}
return $url;
}
If you have email verification enabled then this method will not work because that will require you to finish the email verification first to login.
Also, if you are not redirecting to a dashboard URL you need to replace $url value with a WordPress function instead – get_permalink().
Thank you 🙂