Custom registration and contact info

Hello, I am new to coding and have run into something I cant seem to solve.
I am trying to create a custom member registration for my website that also collects and inputs some contact info into my CRM on Wix.
If anyone could point me in the right direction of a code snipet that might do this I would be helpful. I was able to figure out the registration portion but not the contact info portion.
Again very new to this so any rudimentary help would be appreciated.

Hi Nick,

I believe these articles will help you.

Best,
Sapir

Thanks for the response Sapir, I was trying to follow that article yesterday. I don’t care about the tag portion of that so I think I get myself into trouble when I remove that portion. this is what I have.

import wixUsers from ‘wix-users’;

$w.onReady( function () {
$w(‘#register’).onClick( () => {

// register as member using form data
wixUsers.register($w(‘#email’).value, $w(‘#password’).value, {
“contactInfo”: {
“firstName”: $w(‘#firstName’).value,
“lastName”: $w(‘#lastName’).value,
“phone”: $w(‘#phone’).value,
“street”:$w(‘#street’).value,
“city”:$w(‘#city’).value,
“state”: $w(‘#state’).value,
“birthday”: $w(‘#birthday’).value,
“zip”:$w(‘#zip’).value,
“goal”:$w(‘#goal’).value,
“emails”:$w(‘#email’).value
}
});

});
});

the problem I am now facing is when I click the register button on my registration page nothing happens at all

Hi Nick,

Can you please send us a URL to your site and specify the name of the page so we can inspect?

Best,
Sapir

Thanks Sapir. My website is https://www.p3fitness.co/ I have been trying to do this using a lightbox simply named “register” and am now thinking perhaps I need to use a page dedicated to this purpose not a lightbox? any help or insight you can offer is always appreciated.
Thank You
Nick

Hi,

I believe the problem is that your “register” button has a link to another page after the onClick() even occurs but it also need to do the registration and its can cause a problem.

View the code bellow:

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';

$w.onReady(function () {
  $w('#register').onClick(() => {

 // register as member using form data
    wixUsers.register($w('#email').value, $w('#password').value, {
 "contactInfo": {
 "firstName": $w('#firstName').value,
 "lastName": $w('#lastName').value,
 "phone": $w('#phone').value,
 "street": $w('#street').value,
 "city": $w('#city').value,
 "state": $w('#state').value,
 "birthday": $w('#birthday').value,
 "zip": $w('#zip').value,
 "goal": $w('#goal').value
 // //"emails":$w('#email').value- No Need!
        }
      })
      .then(() => {
        wixLocation.to("...."); //The name of the page
      });

  });
});

Hope its help,
Best,
Sapir

Sapir , thank you so much for the help. That certainly did solve some of the problem. The lightbox now registers someone for the website. However two issues still remain.
#1 the form doesn’t auto fill any contact info to my contacts list, it does transfer my custom fields “birthday” and “goal” but phone and address don’t fill.
#2 after clicking register the users cannot sign up for my “paid plan” and when hey click login they are prompted to my same register page and the cycle seems endless.

Any further thoughts? I apologize for my lack of skills an knowledge

I’m still waiting to find out if we can write to those fields as well. I had to create custom fields to hold the address, city, state, zip, phone fields since I can’t seem to write to the CRM default fields. I called my custom fields: homeAddress, homeCity, homeState, homeZip, homePhone. It works, but it leaves the default fields in the CRM contact form empty.

Hi,

First, phone field suppose to be saved as a string so maybe that’s was the problem.
Reference to the “Address object”, we have checked this issue and reported to our developers.
Meanwhile, in order to add the user’s address details such as city, zip-code, country and more, create new custom field for each option.
View this link in order to learn how to add a custom field, moreover pay attention that you are not choosing address as the field type.

Afterword, in the register() function add to the contactInfo object these custom fields.
At your member list these new custom fields will be presented on each member’s Contact Info.

Best
Sapir

Sapir-

Thank you so much for your help, that certainly solved my CRM problems!
I am facing one last challenge. When someone clicks the login button top right of my website and proceeds to fill out the registration form, they can fill it out, and click register, they are directed to the proper page, however they are not registered or logged in to the website.
However, if a user clicks on my ‘paid plan’ they are prompted to the same registration form and the form functions how it should, registers the user and logs them in.
two questions
#1 is there a reason the same form functions properly when clicked on in the registration box vs. the login bar?
#2 is there a way for me to create a second login only lightbox for users who are already site members?

Thanks again for all your help, I am so close!!

Hi Nick,

I viewed your site and I don’t understand the flow you would like to achieve for your users, can you please elaborate?
Moreover, where is the registration lightbox is being triggered?

Best,
Sapir

Sapir-
I would like a user to be able to click the login button at the top right of the page and be prompted with my registration lightbox in order to register as a member of my site. In the end I want the box to function almost identically default registration window and login window now only I would like to collect some contact details not just email and password.

I hope that answered your questions, again I am new to coding and website design so I wasn’t 100% sure what you were asking.

Thank you for your help
Nick

Hi NIck,

Go to the Login tab’s properties and connect the registration lightbox .
Press Member signup setting and choose the correct light box from the list.
As a result after pressing on the Log in button the lightbox will pop up and not the builtin LogIn form of wix.


Best,
Sapir

@sapirh
Hi Sapir!
Quote: “Reference to the “Address object”, we have checked this issue and reported to our developers.”
Did you get a feedback to this issue? I still couldn´t find a way to add the address, city, state and zip to the standard Contact fields. The contactInfo Object doesn’t contain these values. To use custom fields in CRM is no option for me, because i have to create invoices with wix-invoice which uses the contacts default address fields!
Thanks for your assistance,
Tom

Old post from 2018 reappearing, closed.

This previous forum post will help too.
https://www.wix.com/corvid/forum/community-discussion/member-s-collection-address%3Fpage%3D1%26dl%3D5ce7fb33227f2d0016962c8b%252F5ce333e054670c00a4d64602%252F2