OFFICIAL SUPPORT THREAD for the following contribution:
Extra Fields for Customer Sign Up
Zen Cart 1.3.9
Not yet in the downloads section, but has been submitted.
Enjoy!
Printable View
OFFICIAL SUPPORT THREAD for the following contribution:
Extra Fields for Customer Sign Up
Zen Cart 1.3.9
Not yet in the downloads section, but has been submitted.
Enjoy!
UPDATE: module can now be downloaded from here:
http://www.zen-cart.com/index.php?ma...oducts_id=1694
I have downloaded your contribution, and it works fine for me! Tx!
I'm using this field for the tax number of my costumer.
I wonder how to add this additional field (code) on the invoice.php (Admin section) and packingslip.php, so it will appear on the order when i'm printing it!
Could you help me out with this one?
eOstrE, I haven't tried this yet, but in another thread a user posted this solution:
Original thread: http://www.zen-cart.com/forum/showthread.php?t=73181
I have pasted the code in the document as shown, and i get this error message:
1054 Unknown column 'c.customers_taxid' in 'field list'
in:
[SELECT o.customers_id, c.customers_taxid from zenbooksorders o, zenbookscustomers c WHERE c.customers_id= o.customers_id and o.orders_id = '93806']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
This is rather Chinese to me...
Ahh... sorry that must have been personalized to the name of their custom field. If you installed the module exactly as I built it, the custom field will be named "customers_extrafield"
So, I *think* this would be the correct code instead. Give it a shot and see what happens :)
Add this code at line 28:
so now you can use the $customers_extrafield variable where you want, for example in one of the table cells:Code:$oID = zen_db_prepare_input($_GET['oID']);
//start extrafield
$sql = "SELECT o.customers_id, c.customers_extrafield from " . TABLE_ORDERS . " o, " . TABLE_CUSTOMERS . " c WHERE c.customers_id= o.customers_id and o.orders_id = '" . $oID . "'";
$chk_customers_extrafield = $db->Execute($sql);
$customers_extrafield = $chk_customers_extrafield->fields['customers_extrafield'];
//end extrafield
Code:<?php echo ENTRY_EXTRAFIELD; ?></b><?php echo ' ' . $customers_extrafield; ?>
And it worked!
Thank you so much!
Using V. 1.3.9, fresh install
Almost worked perfect for me, got this on the sign-up page:
EIN Number: (with a box)
ENTRY_EXTRAFIELD (box) ENTRY_EXTRAFIELD_TEXT
Cyndi,
Try step 3 of the installation process:
3. 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
I'll try again, I thought I did that but I may have mistyped too...be right back and thanks for the awesome quick answer.
This is what I had in the extrafield_defines.php...should I also add it to the last one in this row too?
define('ENTRY_EXTRAFIELD', 'EIN:');
define('ENTRY_EXTRAFIELD_ERROR', 'Please answer Extra Field.');
if (EXTRAFIELD_REQUIRED == 'true') {
define('ENTRY_EXTRAFIELD_TEXT', '*');
} else {
define('ENTRY_EXTRAFIELD_TEXT', '');
}
In customers.php I had this for the field:
//start extrafield
define('ENTRY_EXTRAFIELD', 'EIN:');
//end extrafield
Hmm, that looks correct.
Do you have a link to your page so I can have a look?
https://sprinkspets.com/shop/index.php?main_page=login
Thank you, I'm a newbie with ZenCart!
Hmm, the language definition definitely missing somehow. Try re-uploading the language file to the server, see if that fixes it. In fact, you can try re-uploading the whole package (with your changes made).
Okay, and one other quick question, in the unzipped file you have under 1.3.8 another admin file...where should that go? I can't remember where I uploaded that now, I think to the main zc_admin directory.
No, didn't work. And got this for MYSQL patch:
Error Failed: 3
Error ERROR: Cannot ADD column customers_extrafield because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_EXTRAFIELD" because it already exists
Error ERROR: Cannot insert configuration_key "EXTRAFIELD_REQUIRED" because it already exists
Warning Note: 3 statements ignored. See "upgrade_exceptions" table for additional details.
That folder is for Zen Cart 1.3.8 users only, you can remove it from your site.
That SQL error is totally normal - you have already installed the fields, so cannot add them again.
Other than the text, is the field working OK?
When you sign up for account, does the input go to the customer's information inside your Zen Cart admin, as well as to the customer's My Account page?
Yes, it goes in the customer detail for admin, but still comes out as the "customer" update my info as customer:
ENTRY_EXTRAFIELD ENTRY_EXTRAFIELD_TEXT
I would have to take a closer look at testing the code to see why it is not working on your site.
Instead, let's a do a quick fix like so... open /includes/templates/YOURTEMPLATE/tpl_modules_create_account.php
find this code:
replace it with this:Code:<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>': ''); ?>
You can do a similar replacement in the customer account file.Code:<label class="inputLabel" for="extrafield"><?php echo EIN; ?></label>
<?php echo zen_draw_input_field('extrafield', '', 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">*</span>': ''); ?>
Awesome, that worked. THANK YOU THANK YOU....
You're welcome!
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:
You will need to edit /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
Just find this code:
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:
I did not test it, but I *think* it should work.Code:<?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>': ''); ?>
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.
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
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.
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!
You can make the field required or turn it on/off in Admin > Configuration > Customer Details
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 www.longfellowscoffee.com.
Please try installation again, make sure you do ALL the steps!
================= INSTALLATION =====================
1. BACKUP BACKUP BACKUP. (cant say it enough :)
2. Change the name of /YOUR_TEMPLATE/ folders to the name of your template folder (see above for list of files)
3. 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
4. Upload all contents to your main Zen Cart store directory
5. Go to Admin > Tools > Install SQL Patches, and paste the content of the install.sql file
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.
and the next one I installedCode:
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());
Code:
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());
bumpity, bump, bump :blush:
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!!
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:
Code:<!-- 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 -->
Perrrrfect Miss Jackie!!
Thank you so very much for your contribution, time and help!
Much appreciated
Shell xx
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
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?
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
@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)
<?php
if (ACCOUNT_COMPANY == 'true') {
?>
<fieldset>
<legend><?php echo CATEGORY_COMPANY; ?></legend>
<label class="inputLabel" for="company"><?php echo ENTRY_COMPANY; ?></label>
<?php echo zen_draw_input_field('company', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' id="company"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?>
<!-- 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', '', zen_set_field_length(fields, 'customers_extrafield', '40') . ' id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<?php
}
?>
<!-- end extrafield -->
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
Hey Samfire,
Yes, give this a try in your CSS files:
input {
length: 150px;
}
It should be called stylesheet.css, or something along those lines, depending how your template is setup.
Yes, that is true. If you do not want your field lengths to match, you might try this instead.
#extrafield {
width: 150px;
}
You might find the FireBug tool for Firefox or Chrome useful in these situations. Simply right-click the form field you want to change, and click Inspect Element. You will be able to review the code and find out class or ID of the object you're trying to style.
Is there a way to include the information from the Extra Field in the order confirmation e-mail?
Thanks
Hello, this add-on is a lifesaver and I greatly appreciate it. Thank you!
I'm looking to add multiple extra fields to the account creation and account edit pages. I've used the plugin and have been able to get everything working correctly during account creation. The problem is that when attempting to update an account, only the first extrafield that I added is being updated in the database.
Heres what I have done so far:
1. I've added the db fields for extrafield, extrafield2, and extrafield3
2. I've updated all of the files that came with the add-on to reflect all three extrafields is each place that the original extrafield was added. (I've double checked this)
Any suggestions?
@soniccc
haven't tried it, but in theory this should work. find this file: /includes/classes/order.php
and using 'firstname' as an example field, search through the document and every instance of 'firstname', copy and paste that line, then add your variable.
@jahmar
Sounds like there may be something missing in /includes/modules/pages/account_edit/header_php.php
Do a search for 'extrafield' and make sure there is an instance for extrafield2 and extrafield3 in every single place that the other one is.
I've checked through the file a number of times. The fields that I added are extrafield2 and extrafield3. Here is the info I have added in the various locations:
// start extrafield
$extrafield = zen_db_prepare_input($_POST['extrafield']);
$extrafield2 = zen_db_prepare_input($_POST['extrafield2']);
$extrafield3 = zen_db_prepare_input($_POST['extrafield3']);
// end extrafield
// start extrafield
array('fieldName'=>'customers_extrafield', 'value'=>$extrafield, 'type'=>'string'),
array('fieldName'=>'customers_extrafield2', 'value'=>$extrafield2, 'type'=>'string'),
array('fieldName'=>'customers_extrafield3', 'value'=>$extrafield3, 'type'=>'string'),
// end extrafield
$account_query = "SELECT customers_gender, customers_firstname, customers_lastname,
customers_dob, customers_email_address, customers_telephone,
customers_fax, customers_extrafield, customers_extrafield2,
customers_extrafield3, customers_email_format, customers_referral
FROM " . TABLE_CUSTOMERS . "
Like I mentioned the infromation is correctly inserted into the database from the account creation page. Also the first extrafield updates fine from the account edit page.
Any other thoughts on what could be causing this?
Hmmm... when you go to the account edit page, are extra fields 2 & 3 blank, or are they pre-populated with the correct data from account creation?
They are pre-populated with the correct data from the account creation.
how about on the customers edit page in the admin area? can you see the field data there and edit it?
I've also tried to insert the other two values into the database directly using the following command.
$sql = "insert into " . TABLE_CUSTOMERS . " (extrafield2, extrafield3) values (:value1:, :value2:) where customers_id = :customersID";
$sql = $db->bindVars($sql, ':value1:', $extrafield2, 'string');
$sql = $db->bindVars($sql, ':value2:', $extrafield3, 'string');
$result = $db->Execute($sql);
I'm starting to think that the values are not being posted with the form submission. I've checked the field name and ids and they all match correctly.
Only my first extrafield shows up in the customer edit page of the admin area. I can add the other two extrafield to the admin files as well.
try doing that, and see if you can get the backend updates working. Let me know what happens!
It's now updating all three fields correctly from the customer edit page. Still no luck on the account edit page.
I got it working. I honestly do not know how but I thank God. I prayed and placed back online my original header_php.php file and it updated the fields as expected. Thanks for your help and this great module JT.
Glad it's working for you! Sometimes strange things happen and re-uploading is what it takes.
Can we add more than one extra fields using this mod?
I want to add 4 fields to registration form. Does this mod work for me?
Thank you for this awesome plugin, it works perfectly! :D
Is it possible to make the field a dropdown with options, say for different sizes?
I tried the idea of using existing code but the only code I found was for the countries, which seems to get the information from somewhere else rather than manually entering the countries.
Thanks!
@ntestinfo11, yes you can add more fields by following the instructions in readme.txt file
@nakashima, I am unsure why you might want sizes on the sign-up page. Perhaps you are using the sign up in a different way than intended, and there could be a better solution for your needs. Let me know what you're trying to accomplish.
I'd like it so that when the customer signs up they can choose a size and I'll have a record of it. It's to help segment out specific products for specific sizes.
It sounds like you could benefit from a more custom solution. Typically, attributes are used to select size of a product. So it sounds like you would like to store attribute sizes and auto-select for the customer's future orders. That will make their shopping experience easier, and your store management easier. Of course, that would require totally custom code. Just an idea for consideration :)
For now, if you want to manually look at their size from the Customers page, and match it up to the order each time, then you can use a simple dropdown.
The How Did You Hear About Us module has a built-in dropdown and you can edit the fields from the admin. This way, you can easily manage sizes without having to modify code each time: http://www.zen-cart.com/index.php?ma...roducts_id=186
I managed to get it to display the dropdown using an array, but it's not showing the data in the array for the dropdown.
What I have is this:
$extrafieldArray = array();
$extrafieldArray[] = array('id' => '1', 'text' => '1');
$extrafieldArray[] = array('id' => '2', 'text' => '2');
$extrafieldArray[] = array('id' => '3', 'text' => '3');
$extrafieldArray[] = array('id' => '4', 'text' => '4');
$extrafieldArray[] = array('id' => '5', 'text' => '5');
for the array
and then for the dropdown on the registration page:
<?php echo zen_draw_pull_down_menu('extrafield',$extrafieldArray) . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
Any ideas perhaps?
Thank you!
@jackie - thanks for this mod - it is so close to what I need. I've just set up a florist shop for my wife and she wants clients to be able to enter specific information when they register (eg wifes/partners birthday, specific instructions (eg preferred colours). She can then target them with specific bouquets.
@jahmar - I think what you have done, is what I need - I have added an one additional field (added sql to sql and .php files) but I still only see one extrafield box. jahmar is there any way you could share the files you updated so I can see what you changed?
I can send across my email if there is any chance -
Rabbs
Sorry @jackie - you posted earlier:
@ntestinfo11, yes you can add more fields by following the instructions in readme.txt file
I only have instructions.txt (I know this is readme) - but it doesn't say how to add more fields. Is there another readme.txt or...
Thanks in advance
Rabbs
Hmm, perhaps the instructions aren't in there... I will check into that. Basically, the way you would make new fields is by duplicating the "extrafield" throughout the files.
For example, in this file:
includes/templates/YOUR_TEMPLATE/tpl_account_edit_default.php
You would find this code and duplicate it, then add your new variable instead of "extrafield". Let's say, "extrafield2".
Do the same for all the remaining files... find the variable "extrafield" and copy then modify the code.Code:<!-- start extrafield -->
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', $account->fields['customers_extrafield'], 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<!-- end extrafield -->
Then, you'll want to run the Install script for your new field. Swap out "extrafield" for your new variable in the install.txt script, then run in SQL patches.
Thanks Jackie
Really appreciate your quick response - found my errors after some digging and it's now working - I missed changing the extrafield_defines.php - had a brain freeze...
Many thanks!
I did step 3, checked all the files and they seem to be correct, and all I get on my create account page is the following:
ENTRY_EXTRAFIELD [Text box] ENTRY_EXTRAFIELD_TEXT
Any ideas? I'm running 1.3.8a.
I want the label for the entry to be "Wholesale Group", and I'd love to have a dropdown box where they can select one of many options. Can you help me with that?
Looks like you are missing the language definitions files. Try re-uploading the file in \includes\languages
The add-on worked fine. My question is how to add drop down list in this extra field. For example, the extra filed is for the Souce of Information:
option 1: Goggle Search
option 2: yahoo search
option 3: Magizine ads
etc.
Thanks!
Have you figured out how to do it? I tried to create a similar field. I will appreciate it if you can share your solution. Thanks!
If you are looking for customer referral sources, here's a better module for that: http://www.zen-cart.com/index.php?ma...roducts_id=186
Running v1.3.9h and have managed to add an extra filed for telephone (Mobile Number). If I test with setting up a new account, the new field displays and is present when viewing as Administrator, but is empty.
If I Update the test account by logging in as customer and 'View or change my account information', then re-enter the mobile number, it then stores correctly.
Any idea why this might be?
www.fort777.co.za
Hi Jackie,
I downloaded your mod earlier today and I believe I followed the instructions however it is obvious I have missed something or more correctly misinterpreted your instructions. The "display extra field"and "require extra field" both show up in Configuration in admin but there are no changes to the create an account form.
Checking some of the files it appears some have the text 'extrafield' in the strings rather than what I named it - do I go about changing everything I find in all files to "MY_NAME" or do a re-load?
So that you know - I want an additional field to "Company Name" - it will be "Company ABN" (ABN=Australian Business Number) which is required to validate that the account application is from a legitemate company or business (we wholesale) - it would also need a "validate" code, e.g. must be eleven characters with no spaces - with instruction, like for password). Noticeably the "Company Name" section does not have a "*" for required information so it appears that the standard form is designed for consumers, end user customers.
So what would be your advice?
cheers in advance,
Mike
How would you display this field in the orders.php page in the admin? I added it to the invoice, but that code doesn't work for the orders page. Thanks!
I have version 1.0 of this mod and I'd like to add more extra fields. I didn't see any instructions in the instructions.txt file.
How can I do this?
Thanks,
John
Hi,
I know this is a long shot in trying to get a reply. But since this is doing my head in I thought I would ask. I installed this mod successfully the first time then decided to add some more extra fields. Im running version 1.38a and I did get the mod running on the customer side. However when testing to approve customer I am now getting this error and my list of customers will not show up. Any help really appreciated
Fatal error: Call to undefined function zen_get_customers_address_book() in /var/www/XXXXXX/httpdocs/store/admin/customers.php on line 1189
Ok,
I fixed this error just in case other people get it I replaced my file under admin/includes/functions/general.php.
and now it all works
Hello
I installed the customer extra fields works on signup page but when i go to edit account the required fields do not display the error message any ideas why this is.
Thank you
Hi jackie.taferner. Your module is just what I need. I'm running version 1.5 and have tried installing. First time I forgot to configure /YOUR_TEMPLATE/ but then did and reinstalled. On my login page I get an extra box with the title "EXTRA FIELDS" but no fields show up. I have tried checking Admin > Configuration > Customer Details but nothing there. Once I had configured the files, I dragged both the admin folder and the includes folder into the root folder of my site. Did I install correctly? What am I doing wrong? Please help!
Hi,
This is probably pretty easy, but then again I'm not very bright. I want to change the labels in the EXTRA FIELDS section to read something other than Field #1:, Field #2:, etc. Which files, and variables do I need to modify?
Hi Jackie, how can I make the extra fields read only? I would like show details of the extra fields in the account edit but cannot be edited. Thank you.
Sorry to all for my unavailability. I will do my best to check into the forum a little more often. I'll answer the last two questions, and if anyone else still needs help please let me know.
@lafaverp:
The field names are located in /includes/languages/engligh/extra_definitions/extrafield_defines.php
@Defanci:
In the following file: /includes/templates/YOUR_TEMPLATE/templates/tpl_account_edit_default.php
Find the following code:
And replace with this:Code:<!-- start extrafield -->
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', $account->fields['customers_extrafield'], 'id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<!-- end extrafield -->
An alternative would be to display just the text, instead of an input field:Code:<!-- start extrafield -->
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', $account->fields['customers_extrafield'], 'id="extrafield" readonly="readonly"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<!-- end extrafield -->
Code:<!-- start extrafield -->
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo $account->fields['customers_extrafield']; ?>
<br class="clearBoth" />
<!-- end extrafield -->
It works, thank you.
I have an odd problem. I've been running the module for a few months and it's been working fine, but the past couple of weeks the required additional fields for some customers are blank in my database and in admin. I've tried to duplicate the problem but can't. I've tried to create an account in 5 different browsers and each one won't let me create an account without entering data in the required additional fields. When I enter the data and create the account the information shows in my admin just like it is supposed to. However some customers are creating accounts without having to enter that information or it's not storing it, but it isn't every customer. Can anyone point me in the direction of where to start?
Zen Cart v1.3.9h
Extra Field on Customer Sign Up Version: 1.0
Thanks,
Cindy
The required field functionality is based on Javascript. So if a user has Javascript turned off, or if they're a robot (ie. Googlebot or spambot), then they may be able to surpass the required fields.
In the future, we may build required fields into the PHP validation like the default Zen Cart fields, but it's not on the to-do list in the immediate future.
But, rest assured that your customer's information isn't being lost; they just aren't entering the info.
To make this mod compatible with php5.3+, I consider the following is all that needs to be changed.
admin\customers.php
Line 78
change toCode:if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_GET['current'] > 0 && $custinfo->RecordCount() > 0) {
However, if someone could please confirm.Code:if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_POST['current'] > 0 && $custinfo->RecordCount() > 0) {
Is it at all possible to merge this plugin with the Minimum Customer Account Information plugin? My shop currently offers virtual goods only, which makes the MCAI plugin valuable, but doesn't offer a way to require custom account details as this plugin does.
Yes, it is possible to merge the two plugins. Use a program such as WinMerge to determine the file differences, then copy one plugin's code into the other then upload to your server.
If you would like to add your extra field definitions to your order e-mails, you can follow this thread here:
http://www.zen-cart.com/showthread.p...nd-orders-area
The solution will be toward the end of the thread.
I was not able to solve adding the extra fields to the shipping information on each order page. At least now, I am able to have my extra fields display on every order e-mail which is what I was looking for. Hope this helps others.
This mod seems to be great, but I have difficulties to get customer data saved during the account creation. All fields display correctly during account creation, but extrafield content doesn't save.
However extrafields can be edited and saved via account page and admin page.
Could you tell me whats causing this?
It sounds like you may be missing a file from the installation. Did you upload the correct version for your ZenCart? The folders are marked 1.3.9 and 1.5.0. Also, did you change the name of YOUR_TEMPLATE folders to match your template? These are located in both the modules and templates folders. Once you have confirmed both of these items, re-upload the module in case any files are missing.
Thanks for the fast reply, Jackie! :)
I have zc 1.5.1 and installed version for 1.5. I believe I made all needed uploads / merged changes. I've double checked catalog side canges. I'm using Hope template and replaced YOUR_TEMPLATE to that template folder name.
I tested this module on my test store that is 1.5.1 without any mods installed. I Copied files from 1.5 folder and it worked after I had copied template files to classic and templare_default folders.
It sounds like this is a conflict with your custom theme. Try comparing the files in this mod with your existing theme. Use a program like WinMerge to merge the changes into your theme and make sure you overwrite the files on the server.
Thanks for the info! I'll do comparison again and see if I can make it working with my template.
Hello Jackie!
I got it working now! :) There was a conflict with Fast and Easy Checkout -module (sorry that I forget to mention that). That module has it's own file for creating an account (fec_create_account.php).
Originally this file needs to be modified/replaced for this module to work:
includes/modules/custom_template/create_account.php
But if you have fast and easy checkout -module installed, you have to do similiar merging to this file too:
includes/modules/fec_create_account.php
Thanks for posting your solution. I hope this helps others with the same module(s) installed.
Hi Jackie,
I have a really stupid question. How can I tell if a customer wants to have access to wholesale side of my store? Is it supposed to show
somewhere in the "admin" section? I can only find it under the specific customer.
Other question:
I added the radio button to the My Account via includes/templates/classic/templates/tpl_account_edit_default.php
Could you check if it is correct?
<?php
if (DISPLAY_EXTRAFIELD == 'true') {
?>
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?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>': ''); ?>
Thank you very much.
Satu
Hi Satu,
No such thing as a stupid question. You are correct, the only place to see the field is on the individual customer page. If you want it to show up on the main customer list, you would need to make a new column for that. I suggest opening customers.php file and search for extrafield. From there, you can figure what needs to be copied to your new column.
The radio button code looks ok at first glance. Did you upload it to your server and see if it works?
Hi Jackie,
Thanks for getting back to me so quickly!
I did upload the radio button code to the server and it did work. I guess I could remove the * so that it does not look like it is required.
I do not know php that well that I could create a column anywhere, and the customers.php is crazy with modules (very scary).
I forgot to tell you that I have Zen Cart 1.51 and the Extra fields works great. It is excellent module for wholesale part of store.
I'm sure I can find other uses for it also.
Satu