User Registration Plug-In
-
I cannot figure out how to make it work. I find no documentation for it. Can you help me?
-
Ok I have found the Register User section and the password field. So yes, my users can register.
Now I have run into another problem though. In order to register, we have to match up First and Last name. The name field of SmartForms has the two, first and last, but for the user registration it asks for separate first and last names.
And I have another problem. Some of my users find their name through a search box. This is a full name. How can this get entered into the user registration system, when the name is not separated into first and last? Is this possible?
And a third question: How does this work with my form when a user has ALREADY registered and is logged in? Does the form automatically populate the form? I am imagining that for now it does not do this. Will there be a way to integrate registered user information into SmartForms in the future?
Hello!
1.-You can put the name field of your form in both first and last name dropdowns, the plugin will use the right part of the name in both fields.
2.- So you want to use a single field for both first and last name? If so there are some options:
a.- Ugly but quick:Store both first and last name in the ‘First Name’ field and don’t use last name.
b.- Nice but a little bit harder: Use one visible field to store both first and last name and add two hidden fields (which you can hide with css) which with formulas will process the visible field and store the first and last name respectively, you would use these two fields to configure the register user add on.3.- Oh, i think this is indeed a problem. Actually the register user add on will always try to create a user, if it is unable to create it will send a message saying that the user already exist and will ask to use another one, is that not what you need i guess? with an small tweak to the code this could be changed to just submit the form if the user already exists (or if it is already logged in).
For now there is only one fixed value (https://sfmanual.rednao.com/documentation/calculatedfields/formula-fixed-values/), which will automatically populate a field with the User Name, if you have suggestion for more fixed fields (maybe first and last name?) please let me know!
1. Great, I understand that. Glad that aspect works as I hoped it might. Just wasn’t sure.
2. I’ll try this out, thank you for the suggestions.
3. (a) yes that small tweak of the code would be great
(b) Recommendations for fixed values:
First Name
Last Name
EmailWith those, I’d be pretty happy for now.
2.- Alright, please open the file smart-forms-register-userss/user-generator.php and change this:
if(is_wp_error($result))
{
if($result->get_error_code()==’existing_user_login’)
{
$this->_preInsertEntry->ContinueInsertion=false;
$this->_preInsertEntry->AddAction(new ShowMessageInsertEntryAction(“The username is already in use, please choose another one”));
return;
}if($result->get_error_code()==’existing_user_email’)
{
$this->_preInsertEntry->ContinueInsertion=false;
$this->_preInsertEntry->AddAction(new ShowMessageInsertEntryAction(“The email is already in use, please choose another one”));
return;
}
}for this:
if(is_wp_error($result))
{
if($result->get_error_code()==’existing_user_login’)
{
// $this->_preInsertEntry->ContinueInsertion=false;
// $this->_preInsertEntry->AddAction(new ShowMessageInsertEntryAction(“The username is already in use, please choose another one”));
return;
}if($result->get_error_code()==’existing_user_email’)
{
// $this->_preInsertEntry->ContinueInsertion=false;
// $this->_preInsertEntry->AddAction(new ShowMessageInsertEntryAction(“The email is already in use, please choose another one”));
return;
}
}this way the plugin will continue with the submission even if the user already exists.
3.- Alright i will add those fixed values in the next release of the plugin =).
Regards!
Thank you, and thank you!
- The topic ‘User Registration Plug-In’ is closed to new replies.