Using Dokan multi-vendor plugin. Some issues which I am facing, i.e. If a new Vendor register then instead of redirecting to Vendor Dashboard, it is redirected to the home page.
I saw some question woocommerce redirection from my-account but that does not help when I write the same code for prod.
Using these hooks in my function.php
add_filter( 'woocommerce_login_redirect', 'ckc_login_redirect', 10, 2 );
function ckc_login_redirect( $redirect_url, $user ) {
if( $user->roles[0] == 'customer' || $user->roles[0] == 'subscriber') {
return dokan_get_navigation_url('/');
}
return $redirect_url;
}
function plugin_registration_redirect($user) {
if ($user->roles[0] == 'seller') {
return home_url( '/sellerhub' );
} else {
return home_url( '/' );
}
}
add_filter( 'woocommerce_registration_redirect', 'plugin_registration_redirect' );
Somehow it works on my local machine properly but does not work on prod and when new Vendor register then does not show setup wizard on prod but shows setup wizard on local machine. Sharing image too:
Please help if I am doing any mistake.