Wow, I managed to make the extra column on the admin/customers.php.
To my own surprise it even works!
Printable View
Wow, I managed to make the extra column on the admin/customers.php.
To my own surprise it even works!
Glad to hear you were able to add the column! Let us know if you need anything else.
Hello, I have implimented this plugin and it works well. My issue is this. I am using T-Hub with Zen Cart and of course the extra fields information does not import into T-Hub and therefor not into Quickbooks as well. The T-hub people seem as thougbh they are willing to modify t-hub but it is up to me to figure out were the information is beeing located. Can you tell me, were in the database tables the Extra filed information is placed so I can further my dialog with T-hub? Thank you
Extra field data is kept in the customers table along with all the other customer info. They are labeled customers_extrafield, customers_extrafield2, and so on.
Thank you!
Very first post, running zen cart 1.5. Installed the module and it seems to work, I can see the value in the data base using phpmyadmin. It is shown as customers_extrafield and varchar (32). It is a 15 character field in format NNN.NNN.NNN.NNN. so everything seems to have worked. Which is great.
My backoffice vendor has supplied a .php file that creates an orderpacket that is sent to me to process the order. There is a field I can use in this packet UDF01 to send this value to my backend system but I can't seem to get the value to the packet. Here is what the code looks like,
$sessID = zen_session_id();
//Begin Packet -----------------------------------------------------------------------------
$in = "1007|WID=" . $sessID .
"|LID=" . substr($order->customer['email_address'], 0, 80) .
...snip...
"|OID=" . $oID .
"|CN=" . substr($order->billing['company'], 0, 40) .
"|FN=" . substr($order->billing['firstname'], 0, 40) .
"|LN=" . substr($order->billing['lastname'], 0, 40) .
"|BA1=" . substr($order->billing['street_address'], 0, 40) .
"|BA2=" . substr($order->billing['suburb'], 0, 40) .
...snip....
"|EM=" . substr($order->customer['email_address'], 0, 80) .
So I added this code, since it was in the same customer table as the email address I thought I would copy the email mapping ....
"|UDF01=" . substr($order->customer['extrafield'], 0, 25) .
The packet shows the UDF01 but it is blank so my code must not be quite right in getting the value mapped.
I am pretty technical but not a PHP programmer or a sql data base expert. Any help would be greatly appreciated.
Hi stevehdp, It's tough for me to troubleshoot without being hands-on with your code. However, I think you'll find some very useful nuggets of code in the /admin/customers.php file from the module download package. Just search for "extrafield" and you'll find comments for every change made in the file. You will likely find the sq_data_array and extrafield display code the most helpful for your needs. Good luck!
Great Mod thank you, but I need a bit of help please.
I have created an extra field with 2 radio buttons on the account registration page titled "account type", where people select what account type they want to register for. Options are: wholesale account or retail account. This works well and the customer's selection values show on the client info page in admin.
However, I want the chosen field value to also be displayed in a column in the customer list view as well, so that I can see at a glance who has selected wholesale account or retail account during the sign-up process.
I have managed to get a new column appearing in the customer list view titled "Account Type", but I can't seem to get the coding right to get the selected extra field value to appear in the new column. I've tried various permutations of the code in customer.php, to no avail..
Please advise what code to add to customer.php to get the selected values to appear in this column?
The code I added to customer.php:
<td class="dataTableHeadingContent" align="left" valign="top">
<?php echo (($_GET['list_order']=='extrafield-asc' or $_GET['list_order']=='extrafield-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_EXTRAFIELD . '</span>' : TABLE_HEADING_EXTRAFIELD); ?><br>
<a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=extrafield-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='extrafield-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>
<a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=extrafield-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='extrafield-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
</td>
But obviously this is not enough/correct to display the values the customer selected.
@enigma, I suggest searching for extrafield within the customers.php file. You will see all of the display code used to show the field on the individual customer page, which is commented throughout the file to make it easier to find. From there, you can figure what needs to be copied to your new column.
Jackie, thanks for this great mod.
This above code does it move all the extra fields or just one? I would like to use 2 or maybe 3 extra fields but 1 needs to be below company name, like VAT number or so.
For me the above cut and paste is not 100% clear for me, can you help?
Thanks
Regards from Holland
Henk
Hi rmcp, That code moves just one of the fields. You will see additional sets of code for EXTRAFIELD2, EXTRAFIELD3, and so on. Just find the code for the Company name, then cut and paste the EXTRAFIELD code right below it.
If you want this field moved on both the Create Account page and the Edit Account page, make sure you change both templates located in /includes/templates/yourtemplate/templates/
Thanks for the reply
Just to be on the save side :
>>>>>>>>>>>>>>>>>>>>>>>>>
<?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>': ''); ?>
HERE IS WERE I PUT The <!-- start extrafield -->the extra fiels<!-- end extrafield -->?
</fieldset>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
And what do you mean with both files? I do not see any company field in the tpl_account_edit_default.php file
What I want to add are 2 fields, one field below Company name that will be VAT number and also a field were my customers can fill in the model of Motorcycle they use for ordering parts.
Regards
Henk
Please upload your files and I will edit them for you.
Hi Jackie,
Thanks a lot!
I have not changed anything to your files yet so you might as well use the original ones?
If not which file dou you need?
Regards
Henk
I would need both of your files located in: /includes/templates/yourtemplate/templates/
Which version of the plugin are you using?
Sorry for the late answer Jackie
I am sorting out a other problem first ; by some strange reason not all orders show in the admin, id I search for order number I find it and can change it or print invoice but not all orders show in admin orders like you normaly see..........
I'll be back asap with the extra line help
Thanks
Henk
Hi Jackie
Thanks for the plugin, do you know of any issues with the how did you hear about us plugin as your plugin seems to override HDYHAU plugin.
I had how did you hear about us up and running but it is lost.
I am running V2.0 extra fields on Zencart V1.51
Any suggestions would be appreciated.
Peter
www.tenthilltoys.com.au
Yes, this module affects the same files so you will need to compare the files from each module and merge them using a tool such as WinMerge.
Thanks for the fast reply Jackie
I have merged the create account and the customers files, These seem to be the only file that needed doing.
uploaded again, cleared the cache on the browser. but no extra drop down menu.
I will just keep working away at it. I would prefer to have your plugin as it suits me better.
Thanks again
Peter
Thanks for a great mod!
I installed it and it worked fine on the account creation/login page, but the extra fields did not show when I clicked 'edit' further in checkout to test the ability to change info before paying. To be clear, that's the page- ...main_page=checkout_payment_address
I'm on Zen 1.5.1 with only one other plugin, "export_shipping_information_V1.3.2.1," and it does not use any of the same files. I uploaded your mod files a second time as I read that process might contain a common error. And yes, I changed the name of the custom folder. I read something earlier in this thread that seemed to be a similar issue, but that was 2 years ago and it wasn't entirely clear. In the meantime, I turned off all the options.
Any ideas, please?
New install of V 1.5.1 Running on Network Solutions shared hosting. Installed "extra_field_on_customer_sign_up_2-0" plugin and everything works great except when I authorize a newly registered customer no email is sent out.
All other email functions work OK. I have searched for this problem in the forum and in the wild but could find nothing. Anyone else have this problem?
I can't open up my site to the public today but I can probably make it available in a day or two.
Thanks for your awesome plugin!
Did a clean install of the CLASSIC template with NO mods and the following selections for new customer registration.
Customer Shop Status - View Shop and Prices [ 2 ]
Customer Approval Status - Authorization Pending [ 2 ]
When I approve the customer the Approval email goes out as advertized.
Installed the extra fields mod and now the Approval email never shows up in my inbox....
I have been testing on Hosttornado for several weeks now with no other issues.
As stated in my original posting this happens on my hosting plan at Network Solutions too so I don't think their servers are the problem.
I'm just a code hacker but I've been debugging this for two days now and can't seem to find the cause.
Again Thanks for the great mod........
Did some trouble shooting last night and found that if I remove the last three customers_extrafield2-3-4 code but left the first one (customers_extrafield) from /admin/customer.php the customer status update email gets sent.
To clarify I removed it in all three places in the /admin/customer.php file
I then tried removing all but customers_extrafield2 from /admin/customer.php and the email failed.
Tested with all 5 settings in the admin "customer details" screen set to true or false.
While I'm here.... how do you get the customers_extrafields to be included in the "You have a new customer" email the store owner gets?
Thanks
Hello, I've installed and everything presents as expected both on the visible customer sign-up as well as the customer edit info for Admins. However, the values entered in the extra fields do not show up when reviewing with the Admin Edit window –##the field show but there is nothing in it. Thoughts on where to trouble shoot?
Thanks!
I just realized that the Telephone field (and optional Fax) also does not appear on the checkout page to edit info so I'm going to study other threads. Still, if anyone here knows how to do this, please let me know.
I played around some more and got the fields to appear, but then after clicking Continue, noticed the new info wasn't actually added to the order. Instead of spending even more time on this, I realized using text attribute fields on some product pages was a better way to get the info I needed.
In case someone else looks to solve the original question, adding the following to tpl_modules_checkout_new_address made the extra fields appear:
My fields weren't required so I skipped the code of "<?phpPHP Code:
<label class="inputLabel" for="extrafield"><?php echo ENTRY_EXTRAFIELD; ?></label>
<?php echo zen_draw_input_field('extrafield', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_extrafield', '40') . ' id="extrafield"') . (zen_not_null(ENTRY_EXTRAFIELD_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
...
<label class="inputLabel" for="extrafield4"><?php echo ENTRY_EXTRAFIELD4; ?></label>
<?php echo zen_draw_textarea_field('extrafield4', '30','2', $extrafield4, 'id="extrafield4"') . (zen_not_null(ENTRY_EXTRAFIELD4_TEXT) ? '<span class="alert">' . ENTRY_EXTRAFIELD4_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
if (xx == 'true') ..."
Hi,
First; I love the module!
I would like my extrafields to display on the order-information-page in admin. (Not in the email-confirmation).
Is there a clear guide how to do this?
I've read the flowing thread but cant figure it out; http://www.zen-cart.com/showthread.p...ers-area/page2
Could someone please help me with a simple guide how this is done?
Thnd in advance,
JDahlbom
Hello,
I installed the module and sql statement, and all went well. Everything is in the admin, but I see no new fields in on the signup form. Also, there is no label for the STATE field. Anybody else have this problem? Thanks.
Check the "Customer Details" setup in your Admin under the Configuration menu.
Hi,
how can I add the extrafields to admin/invoice.php and to includes/modules/print_invoice.php?
Thanks for the help!:smile:
Hi, I'm using Zen-cart 1.5.1 ver.
Can I use it or no?
ZC 1.5.1 and "Extra Fields for customer sign up" "EXFCSU"
This isn't exactly what you asked for but it may give you some ideas how to use EXFCSU for your purposes. I'm showing the core folders but you can apply this to your "Overrides" folders.
In addition to the standard installation of EXFCSU this is how I expanded the EXF(s) to collect additional information in the registration form " create_account.php " & then add that information to the EXTRA_INFO in the admin copy of the registration sign up emails.
In "includes\modules\create_account.php" around line 733
$extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company, $extrafield, $extrafield2, $street_address, $suburb, $city, $state, $postcode, $extrafield4);
=========================
In "includes\languages\emglish\email_extras.php" around line 20
define('OFFICE_USE','<strong>Office Use Only:</strong>');
define('OFFICE_LOGIN_NAME','<strong>Login Name:</strong>');
define('OFFICE_LOGIN_EMAIL','<strong>Email:</strong>');
// Add company, extrafield, street address, city, state, zip, & extrafield2 defines
define('OFFICE_COMPANY','<strong>Company Name:</strong>');
define('OFFICE_EXTRAFIELD','<strong>Tax ID#:</strong>');
define('OFFICE_STREET_ADDRESS','<strong>Street Address:</strong>');
define('OFFICE_STREET_ADDRESS_LINE2','<strong>Address Line 2:</strong>');
define('OFFICE_CITY','<strong>City:</strong>');
define('OFFICE_STATE','<strong>State:</strong>');
define('OFFICE_POSTCODE','<strong>Zip Code:</strong>');
define('OFFICE_EXTRAFIELD2','<strong>Current Customer:</strong>');
define('OFFICE_EXTRAFIELD4','<strong>My Store:</strong>');
====================
In "\includes\functions\functions_email.php" around line 508
I'm using HTML email but the same could be applied to TEXT emails.
* Function to build array of additional email content collected and sent on admin-copies of emails:
*
*/
function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $company='', $extrafield='', $extrafield2='', $street_address='', $suburb='', $city='', $state='', $postcode='', $extrafield4='') {
// get host_address from either session or one time for both email types to save server load
if (!$_SESSION['customers_host_address']) {
if (SESSION_IP_TO_HOST_ADDRESS == 'true') {
$email_host_address = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
} else {
$email_host_address = OFFICE_IP_TO_HOST_ADDRESS;
}
} else {
$email_host_address = $_SESSION['customers_host_address'];
}
// generate footer details for "also-send-to" emails
$extra_info=array();
$extra_info['TEXT'] =
OFFICE_USE . "\t" . "\n" .
OFFICE_FROM . "\t" . $from . "\n" .
OFFICE_EMAIL. "\t" . $email_from . "\n" .
(trim($login) !='' ? OFFICE_LOGIN_NAME . "\t" . $login . "\n" : '') .
(trim($login_email) !='' ? OFFICE_LOGIN_EMAIL . "\t" . $login_email . "\n" : '') .
($login_phone !='' ? OFFICE_LOGIN_PHONE . "\t" . $login_phone . "\n" : '') .
($login_fax !='' ? OFFICE_LOGIN_FAX . "\t" . $login_fax . "\n" : '') .
OFFICE_IP_ADDRESS . "\t" . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . "\n" .
OFFICE_HOST_ADDRESS . "\t" . $email_host_address . "\n" .
OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n\n";
// LtoMod Add company, extrafield, street address, city, state, zip, & extrafield2
$extra_info['HTML'] = '<table width="100%" class="extra-info">' .
'<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
'<tr><td width="20%" class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
//'<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
($company != '' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
($extrafield != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD . '</td><td>' . $extrafield . '</td></tr>' : '') .
($street_address != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS . '</td><td>' . $street_address . '</td></tr>' : '') .
($suburb != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS_LINE2 . '</td><td>' . $suburb . '</td></tr>' : '') .
($city != '' ?'<tr><td class="extra-info-bold">' . OFFICE_CITY . '</td><td>' . $city . '</td></tr>' : '') .
($state != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STATE . '</td><td>' . $state . '</td></tr>' : '') .
($postcode != '' ? '<tr><td class="extra-info-bold">' . OFFICE_POSTCODE . '</td><td>' . $postcode . '</td></tr>' : '') .
($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
($extrafield2 != '' ? '<tr><td width="20%" class="extra-info-bold">' . OFFICE_EXTRAFIELD2 . '</td><td>' . $extrafield2 . '</td></tr>' : '') .
($extrafield4 != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD4 . '</td><td>' . $extrafield4 . '</td></tr>' : '') .
'<tr><td class="extra-info-bold">' . " " . '</td><td>' . " " . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' . '</table>';
return $extra_info;
}
I installed your add on, but the extra fields are not showing up on the create account page or in the customer's "My Account" page. They do, however, show up in the Admin > Configuration > Customer Details section as "Display Extra Field #1", etc.
I tried to follow instructions carefully, but apparently missed something. Any help would be appreciated. I'm using version 1.3.9. Thank you in advance.
@johninreno, sounds like you may have missed one of the installation steps.
Did you:
2. Change the name of /YOUR_TEMPLATE/ folders to the name of your template folder
3. Open the 2 language files and define the names of your new field(s):
/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
Using Zen Cart Version 1.5.1 Does this plugin work for this version? Also, which customer database(s) are the four new fields being added to?
Sorry, I should have read all the threads before posting. Sounds like it does work with v 1.5.1 and data is added to customers table.
We had a company do updates to our site and some file structures are different than from a standard install. I checked the files structures for the affected files to make sure they match and found that there are some differences.
The admin folder is called 2013. Can I assume I need to rename the admin folder from the download accordingly?
The create_account.php file is currently located at includes/modules/create_account.php which doesn't follow the includes/modules/YOUR_TEMPLATE/create_account.php file structure in the file(s) I downloaded. Should I change the file structure(s) to make sure they match or is this mod creating another create_account.php file that sits within YOUR_TEMPLATE (appropriate name).
If I should adjust the file structure how best to do that. i.e. should I create a YOUR_TEMPLATE (appropriately named) folder in my current file structure so that the create_account.php file is saved there or should I remove the YOUR_TEMPLATE folder from the files I downloaded and place the create_account.php file directly into the modules folder?
Hi All,
I have installed and used this add-on for years now; but only used one of the 4 extrafields that come with it. It's been working fine for me.
My store now has the need to use another field to store some extra customer info; but we want it to be available on the admin side only, and not on the sign-up or account edit pages that customers see. Currently when I turn on an extra field in the config, it's on in all those places.
Is there a clean way to do this rather than editing the template files ? My site is on 1.3.8a. Thanks.
I thought I'd post my own solution here, so unless someone has a better idea, I'll stick to to this (and it might end up helping others looking for a similar feature).
I clone the configuration keys to turn on/off DISPLAY_EXTRAFIELD and name their keys DISPLAY_EXTRAFIELD_ADMIN for each of the customers_extrafield. With these keys I can turn on/off at will.
The I edit /admin/customers.php ; wherever there is this:
I change it to:Code:if (DISPLAY_EXTRAFIELD == 'true')
With this I can choose to have the extra field displayed the normal way or in admin only by setting DISPLAY_EXTRAFIELD_ADMIN to on .Code:if (DISPLAY_EXTRAFIELD == 'true' || (DISPLAY_EXTRAFIELD_ADMIN == 'true')
Good evening,
I tried to install this plugin with 1.5.4. I used WinMerge to try to add the appropriate data while keeping the 1.5.4 structure. I then ran the SQL patch. But now when I try to edit a customer or delete a customer, I get an HTTP 500 error.
I copied all of my old files back to my store and tried to run delete SQL to no avail. Could anyone please help me?
Hi Everyone,
I am trying to get the customers_extrafield information to show on the admin invoice.
I have installed the mod and can edit the field from the customers tab fine (i dont want customers to edit so I have not updated / modified the edit or create account pages)
I saw the code in post #6 but cannot seem to get it to work (code written for 1.3)
zencart 1.5.4
Extra Fields 2.0
any help with this would be great.
I added 50 fields using this plugin, it's working great except for when a user misses a field, it refreshes and displays a missing field warning, and wipes out all the 50 fields, so the user needs to add all of them again. The normal zencart fields don't get wiped out. I have looked at the normal zencart fields, but I don't know what the difference is and why these remain when extra fields become blank.
Thanks for the contribution.
I was wondering if you have an uninstall.sql file for your extra field on customer sign up addon for ZenCart. I would like to uninstall the add-on completely. I tried looking through the ZenCart forum but couldn’t find anything. Thanks
@beverly2345
There is no uninstall script, but you can take the following steps to remove from your database:
1) BACKUP your database! In case something goes terribly wrong, you will want a backup to restore your database from.
2) Open PhpMyAdmin in your hosting control panel, and navigate to your Zen Cart database.
3) Find the following columns in your 'customers' table and delete them:
customers_extrafield
customers_extrafield2
customers_extrafield3
customers_extrafield4
4) Browse your 'configuration' table and delete any rows that have the term 'extrafield' in them. I believe there are 8 instances (2 for each field). You can perform a Search to make this task easier.
Is there a way to require an already existing customer to fill out the newly added field before they can checkout?
@robbinsgj
Yes, you can make the fields required or turn them on/off in Admin > Configuration > Customer Details
Hey guys,
Having a small problem, hopefully you can help me out.
I installed everything via the readme file and it all seemed to be working fine. I can create a customer with the new fields and it writes the data to the database. The only problem I'm having is when a customer tries to update their information if it's incorrect and they click update, it goes straight to a blank white page. No error code or anything. I'm guessing this is a problem in the code somewhere so any ideas?
Using the newest version of ZenCart with the newest version of Sheffield Responsive Blue. :frusty:
This is my first site using ZenCart and I'm loving learning PHP more in-depth.
Cheers guys.
Ash.
Hi @CSGODeimos, sounds like you may be missing some changes in the frontend files. Did you upload the following file(s) to your store?
\includes\templates\YOUR_TEMPLATE\templates\tpl_account_edit_default.php
\includes\modules\pages\account_edit\header_php.php
Note: make sure YOUR_TEMPLATE is renamed to your active template name.
Thanks for the reply. I unzipped the file again, copied those files over to the right places and replaced them (I must of already added them in earlier). It's still doing the same thing. This is literally the only problem I'm having and it's the only think stopping my site from being live :( I love the module, it's amazing and it must be something I've done but I can't figure it out.
Any code or anything I can copy for you to look at?
Ok, let's see if we can figure out exactly what the error is. Can you try following these steps and let me know what your logs say?
https://www.zen-cart.com/content.php?124-blank-page
I fixed it that issue :P There's no white page now! (I just copied my original header_php.php over and it seemed to fix it for the most part.
But now it's now it's showing the field as empty when I click update account settings. (The data used when signing up still goes across to the sql database and in customer info on zen cart admin panel).
Not only is it showing the field as empty but if I type new data into that and click update, it doesn't change in my database or under customer info in the zencart admin panel. The last error log I got was at 1:50 and that was when I was having the blank page issue. It's not giving me an error log for it :S
Last error log:
I appreciate all your help, thanks for having this thread for us noobs.Quote:
[07-Jun-2016 19:50:12 Europe/Berlin] Request URI: /store/fiFty-Ica-plumS/customers.php?page=1&cID=18&action=edit, IP address: 127.0.0.1
#1 trigger_error() called at [C:\xampp2\htdocs\store\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\init_includes\init_responsive_sheffield_blue.php:89]
#3 require(C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\init_includes\init_responsive_sheffield_blue.php) called at [C:\xampp2\htdocs\store\includes\autoload_func.php:48]
#4 require(C:\xampp2\htdocs\store\includes\autoload_func.php) called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\application_top.php:171]
#5 require(C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\application_top.php) called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\customers.php:10]
[07-Jun-2016 19:50:12 Europe/Berlin] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\xampp2\htdocs\store\includes\functions\plugin_support.php on line 68
Ah, that would explain why it is not saving. All of the module files must be uploaded - including the header_php.php file. If you uploaded your original (without the Extra Field code) then the data can't be saved.
You'll need to merge your existing header_php file with the new one in the module folder. Try using a program like Win Merge to see the differences.
HINT: All the changes are denoted with "extrafield" so they are easy to find.
Oh, and try deleting the log file before you review it again. Don't worry - it will regenerate if there are still errors.
I used WinMerge and checked differences, copied all the stuff over that was different. The changes are saving in the mysql database and they're saving in the customer info in the admin panel so they're visible to me but it's not visible in the field when the customer goes to update their account information.
I deleted the logs and the same error comes up but I'm guessing it's nothing serious.
[09-Jun-2016 20:48:47 Europe/Berlin] Request URI: /store/fiFty-Ica-plumS/template_select.php, IP address: 127.0.0.1
#1 trigger_error() called at [C:\xampp2\htdocs\store\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\init_includes\init_responsive_sheffield_blue.php:89]
#3 require(C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\init_includes\init_responsive_sheffield_blue.php) called at [C:\xampp2\htdocs\store\includes\autoload_func.php:48]
#4 require(C:\xampp2\htdocs\store\includes\autoload_func.php) called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\application_top.php:171]
#5 require(C:\xampp2\htdocs\store\fiFty-Ica-plumS\includes\application_top.php) called at [C:\xampp2\htdocs\store\fiFty-Ica-plumS\template_select.php:10]
[09-Jun-2016 20:48:47 Europe/Berlin] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\xampp2\htdocs\store\includes\functions\plugin_support.php on line 68
Can you upload these two files so I can take a closer look at them?
\includes\templates\YOUR_TEMPLATE\templates\tpl_account_edit_default.php
\includes\modules\pages\account_edit\header_php.php
Has anyone tried this mod on zc 1.54?
I have not tested or released an official version for 1.5.4, but it should work fine.
I recommend comparing the module files VS your site's files using WinMerge to be sure.
It works with my 1.54 but I used WinMerge to compare difference between plugin and pluins compatible version and copied the difference to 1.54
When using WinMerge how did which file needed merging. Are they the files that attempt overwriting? and when I merge do I just paste the code that is new for the install?\
And if you dont mind asking how do I merge the files?
I see the files on both sides mostly highlighted but not sure what to do?
I apprecciate any help, thank you
compare with 1.5.4 and copy
// start extrafield
code here
// end extrafield
to corresponding locations
or what I did is
1. download original zencart 1.5.0
3. move "extra_field_on_customer_sign_up_2-0 > zc1.5.0" extracted files to default locations to compare with original zencart 1.5.0
4. in "different files" you will find highlighted
// start extrafield
code here
// end extrafield
and copy this code corresponding locations in 1.5.4
here are the files for 1.5.4 http://www.budgetwebdesign.com.au/ex...-0_zc1.5.4.zip. I did not test them, hope I did not miss something.
I was hoping that someone might still be able to help me with a problem.
I am busy upgrading (my 4yo store) to ZC1.5.5 and this plugin would really make things so much easier.
Managed to install and everything is working fine. But I need the new fields to show up on my invoices.
Tried to implement the ideas as above in the invoice.php file.
However, on the invoice it only shows up 'ENTRY_EXTRAFIELD' (and not the text declared in the language file). Also, the field value (as entered by the customers) does not show up.
I am sure I am just missing something simple but, being only an amateur at this, I can't see the problem...
Any help, anyone?
This module is in dire need of an update for ZC 1.5.6
Thanks for checking
PHP 7.x
ZC 1.5.6a green classic template
The update to 1.56 works GREAT! Thanks!!!
I have been using this plugin for several years now without issues.
However this year when I upgraded to 1.5.6a I am having issues adding the "extrafields" to the customer registration emails.
They are getting entered into the customer account and I am able to view and edit "Customer" information including the "extrafields" in the Admin interface. That tells me the information is getting into the database.
I entered the "extrafields" in email_functions.php as I did last time but the extrafields are not showing up in emails.
All the other customer information is showing up at the bottom of the admin "you have a new account" email like it's supposed to.
I would appreciate a bit of guidance.
Thanks
I did this exact thing in ZC 1.5.1 and it worked like a charm.
In my curent installation of 1.5.6a the data is getting into the database AND into the customers account but NOT included in the email Admin receives when a new person registers.
In addition to installing the latest "Additional customer Fields" V 1.5.6 plugin I made these additions to
email_functions.php trying to get the "Company" name into the email but no joy.
I also tried inserting the "extrafield's" .
Code:Around Line 600
// function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $moreinfo = array()) {
(Changed to)
function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $company='', $extrafield='', $extrafield2='', $street_address='', $suburb='', $city='', $state='', $postcode='', $extrafield4='', $moreinfo = array()) {
Around line 630
($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
/////////////// Added Company Field //////////////////
($company !='' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
Problem SOLVED
After many hours of toiling over a smoking keyboard the only logical conclusion was the "extra_info" array wasn't being created.
Hope this helps some other non-coder like myself in the future.
In includes/modules/your_template/create_account.php I hadn't added the necessary code to generate the "extra_info" array
Around line 440
ORIGINAL Code:
MODIFIE:Code:Code:$extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
Then of course this mod in /includes/functions/email_functions.php around line 590Code:$extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company, $extrafield, $extrafield2, $street_address, $suburb, $city, $state, $postcode, $extrafield4);
ORIGINAL Code:
MODIFIED Code:Code:function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $moreinfo = array()) {
AND modify/add: around line 610Code:function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $company='', $extrafield='', $extrafield2='', $street_address='', $suburb='', $city='', $state='', $postcode='', $extrafield4='', $moreinfo = array()) {
Code:$extra_info['HTML'] = '<table width="100%" class="extra-info">' .
'<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
'<tr><td width="20%" class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
//'<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
($company != '' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
($extrafield != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD . '</td><td>' . $extrafield . '</td></tr>' : '') .
($street_address != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS . '</td><td>' . $street_address . '</td></tr>' : '') .
($suburb != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS_LINE2 . '</td><td>' . $suburb . '</td></tr>' : '') .
($city != '' ?'<tr><td class="extra-info-bold">' . OFFICE_CITY . '</td><td>' . $city . '</td></tr>' : '') .
($state != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STATE . '</td><td>' . $state . '</td></tr>' : '') .
($postcode != '' ? '<tr><td class="extra-info-bold">' . OFFICE_POSTCODE . '</td><td>' . $postcode . '</td></tr>' : '') .
($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
($extrafield2 != '' ? '<tr><td width="20%" class="extra-info-bold">' . OFFICE_EXTRAFIELD2 . '</td><td>' . $extrafield2 . '</td></tr>' : '') .
($extrafield4 != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD4 . '</td><td>' . $extrafield4 . '</td></tr>' : '') .
'<tr><td class="extra-info-bold">' . " " . '</td><td>' . " " . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>';
Has anyone tried this with ZC 1.5.8 and more particularly PHP 8.2?
I see there are wholesale code changes with ZC1.5.8 so, I'm guessing, this plugin would need an update too. Anyone know what would be required?
Any guidance would be appreciated. Thanks.
Has anyone tested Extra Fields for Customer Sign Up on ZC 2.0?
I have used Extra Fields many times in the past without issue. The last ZC version was 5.6. Today I installed Extra Fields for Customer Sign Up on ZC version 2.0
I tested on two different ZC installs (responsive_classic) template one of them was out of the box (NO MODS) and all I get is this.
Attachment 20611
I'm guessing this is a partial blank screen with a debug log. Please post it.
Turned on ALL logging options and nothing there. The first time an extra field entry is accessed it just stops displaying additional content. when viewing source in browser Nothing below the extra field in the page.
Do you know if this has been tested on ZC 2.0?
Attachment 20614
I was curious so I downloaded and attempted to install. The plugin is a bit of a mess.
One reason it is failing is this -
The EXTRAFIELD_REQUIRED constants aren't defined anywhere - I'm guessing they were supposed to be set in admin but this plugin doesn't include this?Quote:
/var/www/html/zencart200/includes/languages/english/extra_definitions/extrafield_defines.php
Line #41 : if (EXTRAFIELD_REQUIRED == 'true') {
Line #47 : if (EXTRAFIELD_REQUIRED2 == 'true') {
Line #56 : if (EXTRAFIELD_REQUIRED3 == 'true') {
Line #64 : if (EXTRAFIELD_REQUIRED4 == 'true') {
Adjusting this code to just assume always true might quickly sort this out - ie remove the if statements.
I don't know how you went about merging the files but the create_account file under modules needs a bit of a tweak compared to older versions.
So, short answer to your question is "no", unless there is someone else out there who is using this and has kept quiet.
This was an out of the box ZC 2.0 install specifically to test on a fresh system.
I did not change anything just followed the instructions which over wrote the existing files.
We are always looking for developers who would be willing to adopt orphaned plugins.
https://docs.zen-cart.com/dev/plugins/adoption/
It's a great way to help support the project.
Forget my question, I can see what's supposed to be going on. Will take a proper look later.
OK, I've updated the plugin and sent linuxguy2 a private link they can download from.
I look forward to hearing back about testing - I'll submit it after some feedback.
It's working for me anyway :)
Great Job!!
NO Issues so far.
Tested with a ZC 2.0 out-of-the-box install and then with my customized ZC 2.0 install.
I'd say it's ready for primetime.
Tested with all 4 and only 1 & 4 Extra Fields
THANK YOU!!!
However,
I tried to get the extra fields to be included in the "Office Only" section of the Admins email and no joy.
Every thing looks OK and after 6 hours of debug I can't find the problem!
I modified "functions_email.php" and "lang.email_extras.php" just as I did with the older versons but no joy.
When I enable the "extrafield" it chokes on "submit".
With just "Company" enabled it doesn't choke but Company does not display in the admin email.
Code:// LtoMod Add company, extrafield, street address, city, state, zip, extrafield2 and extrafield4
$extra_info['HTML'] =
'<table width="100%" class="extra-info">' .
'<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
'<tr><td width="20%" class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
// '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
($login_email !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
($login !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
($company !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
($extrafield !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD . '</td><td>' . $extrafield . '</td></tr>' : '') .
/* ($street_address !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS . '</td><td>' . $street_address . '</td></tr>' : '') .
($suburb !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS_LINE2 . '</td><td>' . $suburb . '</td></tr>' : '') .
($city !== '' ?'<tr><td class="extra-info-bold">' . OFFICE_CITY . '</td><td>' . $city . '</td></tr>' : '') .
($state !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_STATE . '</td><td>' . $state . '</td></tr>' : '') .
($postcode !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_POSTCODE . '</td><td>' . $postcode . '</td></tr>' : '') .
($login_phone !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
($login_fax !=='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
($extrafield2 !== '' ? '<tr><td width="20%" class="extra-info-bold">' . OFFICE_EXTRAFIELD2 . '</td><td>' . $extrafield2 . '</td></tr>' : '') .
($extrafield4 !== '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD4 . '</td><td>' . $extrafield4 . '</td></tr>' : '') .
*/
'<tr><td class="extra-info-bold">' . " " . '</td><td>' . " " . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>';
foreach($moreinfo as $key => $val) {
$extra_info['TEXT'] .= $key . ": \t" . $val . "\n";
$extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . $key . '</td><td>' . $val . '</td></tr>';
}
foreach ($moreinfo as $key => $val) {
$extra_info['TEXT'] .= zen_output_string_protected($key) . ": \t" . zen_output_string_protected($val) . "\n";
$extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . zen_output_string_protected($key) . '</td><td>' . zen_output_string_protected($val) . '</td></tr>';
}
$extra_info['TEXT'] .= "\n\n";
$extra_info['HTML'] .= "</table>\n";
return $extra_info;
}
Nothing in the logs. I think there may be a more basic issue here. Is it some setting in the configuration I'm missing?
I reviewed all the all the mods I did on the old version and especially create_account.php and functions_email.php and they look appropriate.
I'm going to do a fresh install without extrafields and see in the "Company' can be included in the "Office Only" Section
This is additional code I had in the old installation on the new install it creates the account but chokes before displaying the Welcome/Authorization screen.
Works on the old install.
LOGSPHP Code:
$extra_info = email_collect_extra_info($name, $email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
// Worked on old installation $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company, $extrafield, $extrafield2, $street_address, $suburb, $city, $state, $postcode, $extrafield4);
logmessage
Log reset by {xxxxser[1]}.
Accessed page [admin_activity.php]
Accessed page [index.php]
Accessed page [keepalive.php]
Accessed page [admin_activity.php]
Accessed page [admin_activity.php] with action=save. Review page_parameters and postdata for details.
Admin Activity Log accessed. Output format: CSV. Filter: all. (Download to browser)
Accessed page [index.php]
Accessed page [keepalive.php]
Accessed page [admin_activity.php]
Accessed page [admin_activity.php] with action=save. Review page_parameters and postdata for details.
Admin Activity Log accessed. Output format: CSV. Filter: all. (Download to browser)
I'm guessing that in the old installation, you edited includes/functions/functions_email.php and changed function email_collect_extra_info() to account for these extra arguments.
Rather than do that, it would be better for you to populate the moreinfo array with this data.
add , $moreinfo as the last call to email_collect_extra_info in includes/modules/YOUR_TEMPLATE/create_account, i.e.
$extra_info = email_collect_extra_info($name, $email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $moreinfo);
then right before this line:
$moreinfo = [];
if (EXTRAFIELD_REQUIRED == 'true') {
$moreinfo[ENTRY_EXTRAFIELD] = $extrafield;
}
if (EXTRAFIELD_REQUIRED2 == 'true') {
$moreinfo[ENTRY_EXTRAFIELD2] = $extrafield2;
}
if (EXTRAFIELD_REQUIRED3 == 'true') {
$moreinfo[ENTRY_EXTRAFIELD3] = $extrafield3;
}
if (EXTRAFIELD_REQUIRED4 == 'true') {
$moreinfo[ENTRY_EXTRAFIELD4] = $extrafield4;
}
Note to @royaldave - we need a notifier here too so this can be done without changing this core file.
Well, you made that look easy... Thank You Both!!
Yes in the old installations I did modify the files you referenced.
I implemented the changes you recommended and it did pull the extrafields into the Office Only section of the Admin email.
So I should be good to go.
I plan to add the company name and address.
Thank You royaldave !!
One more time,
Need a way to include the Company Name, Address Line 2, City and Zip Code to the "Office Only" section of the Sign Up form email.
Because this is information is already collected on the sign up form why not have a way to add it to the email?
I am already using the other 4 "Extra Fields for Customer Sign Up (Create Account) Page" fields to collect other data.
Rather than Hacking the core code I'd appreciate some guidance.
Thanks
I have suggested that RoyalDave look into using the Observer Notifier feature in Zen Cart to build this plugin without needing to modify core code at all. If and when he does that, you'll be able to tag on to his work.