New Zenner
- Join Date:
- Jan 2011
- Location:
- US
- Posts:
- 37
- Plugin Contributions:
- 0
Extra Fields for Customer Sign Up (Create Account) Page
Awesome, that worked. THANK YOU THANK YOU....
Views: 264,912
New Zenner
Awesome, that worked. THANK YOU THANK YOU....
Totally Zenned
You're welcome!
New Zenner
Hi Jackie
I have just installed the module on v1.3.9g store and it is working fine. My question is though how can I change this field to a yes / no field. I need a question like rural delivery - yes/no as my extra field.
Do I just need to change the field in the database or will it require other changes too. Thanks:unsure::unsure::unsure:
Totally Zenned
You will need to edit /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
Just find this code:
<?php echo zen_draw_input_field('extrafield', '', 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
And replace with this:
<?php echo zen_draw_radio_field('extrafield', 'yes', '', 'id="extrafield-yes"') . '<label class="radioButtonLabel" for="extrafield-yes">Yes</label>' . zen_draw_radio_field('extrafield', 'no', '', 'id="extrafield-no"') . '<label class="radioButtonLabel" for="extrafield-no">No</label>' . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
I did not test it, but I think it should work.
You can do a similar edit in the tpl_account_edit_default.php file, so your customers see the same radio button on their My Account page.
New Zenner
Hi Jackie
Got the radio buttons showing up at sign up and on the account edit screen thank you. Unfortunately the buttons don't retain the setting. When I go into the account after creating a new one the radio buttons are there but neither are turned on.
Also I am not sure of what exactly I put in the phpmyadmin to change the customers table. I know I need to change the customers_extrafield but not sure what to replace it with. I have limited knowledge of mysql and I couldn't find the answer on the internet
thanks for your time
Totally Zenned
Your best bet will be to compare the salutation or gender button on the Account Signup page. If you use the same technique, you should be abel to get the same results with the Yes/No button.
New Zenner
Is there a way to make the field a non required field? I noticed it shows up as a required field and I'm using the field so Affilliates can enter their registration number to qualify for a group discount. All of the customers are not affilliate members so if they're not I'd like them not to have to put something in this field. Thanks in advance!
EDIT---
Never mind! I found it in the extrafield_defines.php file!
Totally Zenned
You can make the field required or turn it on/off in Admin > Configuration > Customer Details
New Zenner
Hi. I am using 1.3.9h and am trying to install the Extra fields. It doesn't seem to be working. I believe that I followed the instructions properly but nothing is showing up. One thing that I noticed is that I have a mandatory field below the "country" field with a blank heading. This should probably be the "state" field. Could this mod have caused this? I can see this causing problems when someone tries to sign up. Please help.
My site is https://www.longfellowscoffee.com.
Totally Zenned
Please try installation again, make sure you do ALL the steps!
================= INSTALLATION =====================
BACKUP BACKUP BACKUP. (cant say it enough :)
Change the name of /YOUR_TEMPLATE/ folders to the name of your template folder (see above for list of files)
Open the 2 language files and define the names of your new field:
/includes/languages/english/extra_definitions/extrafield_defines.php
/admin/includes/languages/english/customers.php
Upload all contents to your main Zen Cart store directory
Go to Admin > Tools > Install SQL Patches, and paste the content of the install.sql file
New Zenner
Thanks for making this add on, I am able to make it work. But I have a question, I am trying to add more fields and can get them all set up except when I fill out the form, I get errors saying I need the required info. I think it may be the install file but I am not sure, the tables are in the database. All I did to the install file is change the info. here are the changes, and what the fields look like before and after I submit the form.
ALTER TABLE customers ADD customers_ca_id varchar(32) NOT NULL AFTER customers_fax;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display CA ID', 'DISPLAY_CA_ID', 'true', 'Display "ca id" on account creation page', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require ca id', 'CA_ID_REQUIRED', 'true', 'Require the Extra Field in account creation', '5', '7', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
and the next one I installed
ALTER TABLE customers ADD customers_dr_rec varchar(32) NOT NULL AFTER customers_ca_id;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display DR REC', 'DISPLAY_DR_REC', 'true', 'Display "dr rec" on account creation page', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require dr rec', 'DR_REC_REQUIRED', 'true', 'Require the Extra Field in account creation', '5', '7', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
New Zenner
bumpity, bump, bump :blush:
New Zenner
This worked perfect for me - Thanks!!
Just wanting to know how to move the 'extra field' out of the 'more contact details' area and place it under the 'Company Name' ?
Im using the extra field for an ABN Number: and would rather it went under the Company Name.
Any suggestions would be great!!
Totally Zenned
shellbell, to move the field open this file:
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
and move this code to the section you want the field in:
<!-- start extrafield -->
<?php
if (DISPLAY_EXTRAFIELD == 'true') {
?>
<br class="clearBoth" />
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', '', 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<?php
}
?>
<!-- end extrafield -->
New Zenner
Perrrrfect Miss Jackie!!
Thank you so very much for your contribution, time and help!
Much appreciated
Shell xx
Totally Zenned
you're welcome shellbell!
chepnut, sorry i missed your post until now. Maybe it's too late, but I'll try to post a solution anyhow.
Check to see that you've got the new field in Admin > Configuration > Customer Details. Also, make sure your new field is added in all the appropriate files. Open the files and find everywhere it says "extrafield" - using extrafield as a guideline, copy and paste then change the variable to your new field. My guess is you may have missed one in this file (but check all files just in case):
/includes/modules/YOUR_TEMPLATE/create_account.php
New Zenner
Hey, got the module working and it's great, thanks! Just wondering if it's possible to get that new field emailed with the Create Account emails?
Zen Follower
Hi
How to control the width of the extra field ?
I want it to be wider.
Meaning I put a long question as the extra field but it is cut
to six lines because of the short width.
Site: adi-beauty (dot) com
Thanks
Totally Zenned
@buzzfever, I haven't tried it, but it should be fairly straightforward. Open includes/languages/english/create_account.php and copy/paste one of the other fields as an example, then replace the variables with your 'extra field'
@gunni, CSS should help you with the length of the form field. Try adding something along these lines:
input {
length: 150px;
}
If you're talking about the actual number of characters in the form field, you could fix this limit in MySQL by going to customers table, and under customers_extrafield change varchar to a larger number.
New Zenner
jackie.taferner:
@buzzfever, I haven't tried it, but it should be fairly straightforward. Open includes/languages/english/create_account.php and copy/paste one of the other fields as an example, then replace the variables with your 'extra field'
@gunni, CSS should help you with the length of the form field. Try adding something along these lines:
input {
length: 150px;
}If you're talking about the actual number of characters in the form field, you could fix this limit in MySQL by going to customers table, and under customers_extrafield change varchar to a larger number.
Hi Jackie
I uploaded/installed your mod ty v much
one issue I am having - may be related to above,
I tried to change the field box size on the account registration form, I'm using the extra field for the customer to put their website in..... but what ever value I put in the files (see below) it just reduces it to a really small field box size
files edited::::
tpl_account_edit_default.php
and
tpl_modules_create_account.php
it's always the same result what ever number i put it for e.g. in module create account as I have pasted below here....
(i have pasted both the 'company' code and the 'extra field' code for comparison)
am i editing the wrong file(s)?
maybe i'm missing the obvious after trying to do this for 2 hours!!!lol
any help
massively appreciated
thanks
Tell staff why this post should be reviewed.