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.
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
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
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
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.
https://support.wix.com/en/article/adding-custom-fields-to-contacts
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
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,
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
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
Hi Nick,
I believe these articles will help you.
https://support.wix.com/en/article/integrating-wix-code-forms-with-your-contacts
https://support.wix.com/en/article/wix-code-tutorial-creating-a-custom-registration-form-with-code
Best,
Sapir