• Resolved pouriya91

    (@pouriya91)


    Hello dear,

    I have a B2B website and in the same time I need a registration form for 4 different users, such as company ,organisation ,volunteer and guest
    I need when they’re registering ,choose from which category they are ,and through that category they just redirect to a specific page,

    Like company redirect to the home page and if he is volunteer, then automatically redirect to the volunteer page,

    Is it possible with this plugin?

    Thank you

Viewing 1 replies (of 1 total)
  • Hi @pouriya91,

    Sorry for the delayed response.
    The feature that you are looking to have is not possible out of the box directly but there is a workaround that will work for your case.

    First, you need to make a registration form with a dropdown field where you can define 4 different choices: company, organization, volunteer, and guest. These will be the four different choices for registering customers.
    Depending upon what a user selects during registration, they will be assigned a role and then be redirected to a specific page. So, to assign them a role based on their selection, you need to have the Conditional Logic feature of User Registration. After you have that, you can follow this doc: https://docs.wpeverest.com/user-registration/docs/how-to-conditionally-assign-user-roles/

    You can create new user roles for your WordPress site and give them specific permissions using a third party user role editor plugin.

    Now the second part is to redirect them to a specific page after the registration is complete. For this, you will need to paste the following code in your active theme’s functions.php file.

    Here is the code:

    //code for redirect after registration depending on user roles(UR)
    add_filter( 'user_registration_redirect_from_registration_page', function( $redirect_url, $current_user ) {
                $current_user = (object) $current_user;
                $roles = isset( $current_user->roles ) ? (array) $current_user->roles : array();
                if ( in_array( 'subscriber', $roles, true ) ) {
                    $redirect_url = 'https://subscribers-come-here.com';
                }
                if ( in_array( 'customer', $roles, true ) ) {
                    $redirect_url = 'https://customers-come-here.com';
                }
                return $redirect_url;
            }, 10, 2 );
    

    Note: Edit the conditions defined in the code as per the roles that you create and it will work as expected.

    I hope it helps.
    Regards!

Viewing 1 replies (of 1 total)
  • The topic ‘registration form with different kind of users’ is closed to new replies.