• Resolved flo1982

    (@flo1982)


    Hello,

    I enable a vendor registration by vendor-registration.php.
    I disabled the dokan wizard.
    After pass the vendor-registration.php successfully the visitor is redirected to the start page of the shop.
    How can I redirect the visitor to a custom page like registration-successfull ?

    Kind regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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 ??

    Thread Starter flo1982

    (@flo1982)

    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 ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect after vendor registration’ is closed to new replies.