Thank you for your time, I hope someone can help with this as Wix customer support will not tell me, they tell me to wait for a forum response.
The help files show ContactInfo {firstName: string, lastName: string, picture: string, emails: Array, loginEmail: string, phones: Array, labels: Array, language: string, customFields: string | number | Date}
But how do we write to the ADDRESS fields (Street, City, State, Zip, Country)? are they labels or custom fields? or part of the ContactInfo?
I have tried every possible guess, including exporting contacts to csv to see what Wix calls them - but nothing works.
What are the field names called to write to??
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(‘#submitB’).onClick( () => {
let firstName = $w(‘#firstName’).value
let lastName = $w(‘#lastName’).value
let address = $w(‘#address’).value
let city = $w(‘#city’).value
let state = $w(‘#dropdownState’).value
let zip = $w(‘#zip’).value
let phone = $w(‘#phone’).value
let email = $w(‘#email’).value
let password = $w(‘#password’).value
wixUsers.register(email, password, {
contactInfo: {
“firstName”: firstName,
“lastName”: lastName,
“Address”: address,
“City”: city,
“State”: state,
“Zip”: zip,
“Phones”: [phone]
}
} )
.then( (result) => {
let status = result.status; // “Active”
let user = result.user;
wixLocation.to("/plans-pricing");
})
// this.close();
});
});