Do you have an idea about how to get a newly registered user into a Members database?
With the code below, the user is registered as a user/visitor only …
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
$w.onReady(function(){
$w('#register').onClick(function (){
let email = $w('#email').value;
let password = $w('#password').value;
wixUsers.register(email,password)
.then(()=>{
wixLocation.to(`/Members/${wixUsers.currentUser.id}`);
})
})
})
Any idea, how to edit code that will add user/visitor into Member database?
Well, I checked all related links, and none of them solving my situation.
Nayeli’s video is cool, but she doesn’t use her own member’s database.
So far, I tried to combine my code with the one mentioned in the last link but without success.
When a user registers on your site to become a site member all their details of email and password are saved into the Wix CRM and you can see their email on your Contacts List in the Wix Dashboard.
If you want to have a separate members dataset, then you need to do something like that members profile tutorial.
This works perfectly for me and closes after registering details before moving users onto a signup status page, then both names will be saved in Contacts and once site member is manually approved the member details will be added to ‘members’ database which is from that same members profile tutorial.
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#registerButton").onClick( (event) => {
let email = $w("#email").value;
let password = $w("#password").value;
let first = $w("#firstName").value;
let last = $w("#lastName").value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
}
} )
.then( (result) => {
let resultStatus = result.status;
wixWindow.lightbox.close();
wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
} );
} );
});