I need your help. On our website, when we register, we have 3 proposed registration statuses: client, partner, professional. I would like to know how to do so that when they connect my router (if it is the router the solution) redirects them directly to the page that is reserved for them.
I need your help. On our website, when we register, we have 3 proposed registration statuses: client, partner, professional. I would like to know how to do so that when they connect my router (if it is the router the solution) redirects them directly to the page that is reserved for them.
@contact51231 Please add more details. Where do you store the statuses? Are you talking about specific page or every page on this website? Do you already have some routers ? When do you want the redirection to take place?
@jonatandor35 The statutes are stored in the section “members of the site” which allows me to give them the necessary authorizations to access the pages dedicated to them.
I don’t have a router.
I would like my router to redirect once the member connects, if he is authenticated as a client he is redirected to the client interface, if he is authenticated as a partner that he is redirected to the partner interface, etc …
No they are not in a database, I can’t do it, I use a personalized registration form, create by six when we create a member section on our site. Yes I define roles by users.
@contact51231 No. This code is for the page code panel (if it’s relevant for a specific page) or for the site code panel (if it’s relevant for all pages).
The user register (choice statut, client, professionnel…) 2. The user connect 3. after connect user redirected on the page specific for client or proffessional…
If you want the user to be redirected from the registration page it’s easy. But if you want the user to be redirected any time he/she logs in, it’s different (and you’ll need to store the role).
Anyway for redirecting from the registration page (page code) →
import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
let status;
$w.onReady(() => {
$w("#checkBoxGroup1").onChange(event => {
status = $w("#checkBoxGroup1").value;
})
wixUsers.onLogin(() => wixLocation.to(`/${status}`));//assuming that the page path and status are the same.
})
This example demonstrates the use of routers for three different types of site visitors: anonymous (free), freemium, premium:
Stripe Payment Processing
Integrate the Stripe Payment processing system into a site. Three levels of user access are demonstrated: visitor, freemium (registered), and premium (paid).
@jonatandor35 Hmm, not sure it needs to redirect on login. The routers take care of redirection based on the user’s status: free (anonymous visitor), freemium (logged in), premium (logged in and paid up).