Wordpress new seller is net redirecting to dashboard in Dokan, Also setup wizard does not show up on prod but everything is working on local machine

689 views Asked by At

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: enter image description here

Please help if I am doing any mistake.

0

There are 0 answers