New Zenner
- Join Date:
- Jun 2007
- Posts:
- 71
- Plugin Contributions:
- 0
Additional Customers Fields
I just emailed you the info.
Views: 88,143
New Zenner
I just emailed you the info.
Suspended
Email replied. Please confirm the details. In the mean time, this discussion should be done over email until it is done in order to avoid creating threads uselessly.
New Zenner
I am not sure if this applied to my inquiry. And after input from a few others, there is still no identifiable solution on my problem. Client side is not showing new field and on the Admin side, no fields are showing at all, although the table in which they should be is there.
ANY input or advice would be helpful. I am desperate and I figured that this should be fairly easy to just add one extra field for a customer.
Thank you again.
VV
TheOracle:
Can't see any template readings between your while and ending while statement from your tpl_modules_create_account.php file yet.
I assume this error comes from your admin/customers.php file.
See that you have something like:
UPDATE " . TABLE_CUSTOMERS . " SET " . $additional_sql . " WHERE customers_id = '" . (int)$customers_id . "'
>
> This part of instruction is also stated from my installation guide.
>
> The produced error from your end means that you did not incorporated my modules correctly under that file since the $additional_sql variable cannot be initialized for your case. See the installation instructions again on this matter as you must assure to have downloaded the latest version of this MOD from my site.
Suspended
A-Z steps ? (Technical - not just theorical).
Suspended
@repple:
Your last email was received as I'm currently working on it. Your last specifications are working correctly. Next update to come . . .
New Zenner
Since I am new to this, I am not sure what A-Z steps means. I can provide any information that you need except installation of the product as I had a programmer doing that (was beyond my scope of knowledge) and even they had difficulties. So please, just ask and I can get answers... I am just not sure I know where to begin for you on this venture.
VV
Suspended
I can provide any information that you need
Then, please provide from the beginning to the end (technicly). What did you do so that it would result this way ?
Zen Follower
Hi,
Great mod - sorely needed! Unfortunately, though, I'm having some problems with it.
Adding new fields via Admin works fine. When I then edit the various files I think I'm supposed to edit, adding new customers brings up the new fields very nicely both in Admin and Catalog pages. BUT, if I want to edit one of these new customers, the fields only show up in the Admin area, not in the Catalog's My Account edit page!
Is there anything about this that is obvious to you that I might check, or would you like me to send specific details of all the files and changes I made?
Thanks!
Suspended
Is there anything about this that is obvious to you that I might check
The last numerous pages reports the same type of problems as I have responded so many times on this on this topic. The reason why it is NOT showing on your page, fro the store-end, is because you probably didn't edited your override template files + your extra_definitions language file.
I will say it again; it does NOT appear automatically as you MUST edit your override template files + the extra_definitions folder for EACH additional customers fields you add from the admin section (and assure that it's activated).
Suspended
http://www.zen-cart.com/forum/showpost.php?p=395808&postcount=383
Update:
A new small update has just been released on my site (and YES - from my site !). The reason on why the $additional_sql was not found during the update was because the variable wasn't predefined first.
Again, only slight changes has been done as it should work correctly now.
Zen Follower
Thanks for quick response. Actually, though, I did indeed make all the changes to all the files as instructed in your install procedures. Also just downloaded, compared and corrected the 3 files mentioned in your most recent post about "variable wasn't predefined first." Still have same problem.
Details of the various file changes are (BTW, "pogo" is the name of my "your_template"):
FILE:
…admin/includes/languages/english/extra_definitions/additional_customers_fields.php
//---------------------------------------------------------------------------------
define('BOX_CUSTOMERS_ADDITIONAL_CUSTOMERS_FIELDS', 'Additional Customer Fields Module');
define('ADDITIONAL_CUSTOMERS_FIELDS_FORM_TITLE', 'Student Delivery Details');
//---------------------------------------------------------------------------------
```and…
```php
$additional_customers_fields_form_input_title['customers_studentname'] = array('Student\'s Full Name: ');
$additional_customers_fields_form_input_title['customers_studentdorm'] = array('Dorm Name: ');
$additional_customers_fields_form_input_title['customers_studentroom'] = array('Room Number: ');
$additional_customers_fields_form_input_title['customers_studentcell'] = array('Cellphone: ');
$additional_customers_fields_form_input_title['customers_student_email'] = array('Email: ');
$additional_customers_fields_form_input_title['customers_student_roommate'] = array('Roommate\'s Name: ');
``` **FILE:**
**…includes/languages/english/extra_definitions/pogo/additional_customers_fields_create_account.php**
```php
// Defines the additional customers fields title in order to show in HTML forms.
define('ENTRY_ADDITIONAL_CUSTOMERS_FIELDS_TITLE', 'Student\'s Details');
define('HEADING_ADDITIONAL_CUSTOMERS_FIELDS_CREATE_ACCOUNT_TITLE', 'Student Delivery Information');
// Defines the hobbies title name for the additional customers fields.
``` and…
```php
// Defines the customers student info for the additional customers fields.
$additional_customers_fields_form_create_account_input_title['customers_studentname'] = array('Student\'s Full Name: ');
$additional_customers_fields_form_create_account_input_title['customers_studentdorm'] = array('Dorm Name: ');
$additional_customers_fields_form_create_account_input_title['customers_studentroom'] = array('Room Number: ');
$additional_customers_fields_form_create_account_input_title['customers_studentcell'] = array('Cellphone: ');
$additional_customers_fields_form_create_account_input_title['customers_student_email'] = array('Email: ');
$additional_customers_fields_form_create_account_input_title['customers_student_roommate'] = array('Roommate\'s Name: ');
FILE:
…includes/languages/english/extra_definitions/pogo/additional_customers_fields_account_edit.php
// Defines the additional customers fields title in order to show in HTML forms.
define('ENTRY_ADDITIONAL_CUSTOMERS_FIELDS_TITLE', 'Student Details');
define('HEADING_ADDITIONAL_CUSTOMERS_FIELDS_ACCOUNT_EDIT_TITLE', 'Student Delivery Information');
``` and…
```php
// Defines the customers student info for the additional customers fields.
$additional_customers_fields_form_account_edit_input_title['customers_studentname'] = array('Student\'s Full Name: ');
$additional_customers_fields_form_account_edit_input_title['customers_studentdorm'] = array('Dormitory Name: ');
$additional_customers_fields_form_account_edit_input_title['customers_studentroom'] = array('Room Number: ');
$additional_customers_fields_form_account_edit_input_title['customers_studentcell'] = array('Cellphone: ');
$additional_customers_fields_form_account_edit_input_title['customers_student_email'] = array('Email: ');
$additional_customers_fields_form_account_edit_input_title['customers_student_roommate'] = array('Roommate\'s Name: ');
```**FILE:** **…includes/templates/pogo/templates/tpl_modules_create_account.php**
```php
// We now set up additional customer fields for student info.
echo add_customers_fields_for_create_account('customers_studentname', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentdorm', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentroom', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentcell', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_student_email', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_student_roommate', 'zen_draw_input_field');
// End of additional customer field for student info.
``` **FILE:**
**…includes/templates/pogo/templates/tpl_account_edit_default.php**
```php
// We now set up an additional customer field for student name.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentname") {
echo add_customers_fields_for_account_edit('customers_studentname', 'zen_draw_input_field');
} // End of additional customers fields for student name.
// We now set up an additional customer field for student dorm.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentdorm") {
echo add_customers_fields_for_account_edit('customers_studentdorm', 'zen_draw_input_field');
} // End of additional customers fields for student dorm.
// We now set up an additional customer field for student room.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentroom") {
echo add_customers_fields_for_account_edit('customers_studentroom', 'zen_draw_input_field');
} // End of additional customers fields for student room.
// We now set up an additional customer field for student cell.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentcell") {
echo add_customers_fields_for_account_edit('customers_studentcell', 'zen_draw_input_field');
} // End of additional customers fields for student cell.
// We now set up an additional customer field for student email.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_student_email") {
echo add_customers_fields_for_account_edit('customers_student_email', 'zen_draw_input_field');
} // End of additional customers fields for student email.
// We now set up an additional customer field for student roommate.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_student_roommate") {
echo add_customers_fields_for_account_edit('customers_student_roommate', 'zen_draw_input_field');
} // End of additional customers fields for student roommate.
```I get no php errors, so assume my edits were acceptable to php at least. What is it I seem to be missing here?
Thanks.
Suspended
Snif. Finally someone who posts full details of what has been done and posted with PHP blocks code. 'scuse me - I have something in my eye. :cry:
Also just downloaded, compared and corrected the 3 files mentioned in your most recent post
Is that so ? Then why do I see duplicated entries from your create account template file ?
// We now set up an additional customer field for student dorm.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentdorm") {
echo add_customers_fields_for_account_edit('customers_studentdorm', 'zen_draw_input_field');
} // End of additional customers fields for student dorm.
// We now set up an additional customer field for student room.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_studentroom") {
echo add_customers_fields_for_account_edit('customers_studentroom', 'zen_draw_input_field');
} // End of additional customers fields for student room.
includes/languages/english/extra_definitions/pogo/
Perhaps I did missed something but the languages should not used subfolders within the extra_definitions folder. As you can see, from my package, there are no subfolders within that folder.
Same for the account edit file.
As for your templates folder though - seems fine except for the duplicated field entry. :wink2:
Suspended
As for this block, forgot to state that:
// We now set up additional customer fields for student info.
echo add_customers_fields_for_create_account('customers_studentname', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentdorm', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentroom', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_studentcell', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_student_email', 'zen_draw_input_field');
echo add_customers_fields_for_create_account('customers_student_roommate', 'zen_draw_input_field');
// End of additional customer field for student info.
does not contain any if statement conditions from your create account template. These are not suggested procedures but rather highly recommended. :wink2:
Suspended
FILE:
…admin/includes/languages/english/extra_definitions/additional_customers_fields.php
In addition from the above, this PHP file is no longer valid. Make sure to have followed the changelog and upgrade documentation due to the last changes that were made regarding this file. By now, you should not use it but rather eliminate it.
Zen Follower
Thanks for getting back to me. Let me answer each post specifically:
#392 - I'm not sure what you mean by "duplicate entries". I added 6 new customer fields, so assumed that each field needed to be listed separately in the tpl create account file as well as the tpl account edit file. The php quote in your post shows 2 different fields, namely "studentDORM" and "studentROOM", so not sure what was duplicated.
As far as subfolders in the extra_definitions folder, I saw that the Zen Cart Demo store has a "classic" folder in its extra_definitions folder, so assumed normal override rules and created the pogo folder with your create account and account edit files.
#393 - Not sure what you're referring to re: if statements. There weren't any if statements in your examples (I followed your "cellphone" sample in every file) in the create account file, so I didn't add any. There were if statements in the account edit file, and as you can see I used them for all 6 new fields. So, don't understand what you're telling me here.
#394 - I eliminated the admin/includes/languages/english/extra_
definitions/additional_customers_fields.php file, as you suggested. Unfortunately, no change - the new fields still don't appear in the account edit screen in the store.
I appreciate your help, and very much look forward to getting this mod to work, as I need to further customize the site by adding these new fields to the checkout order confirmation page and email.
Thanks.
Suspended
#392 - I'm not sure what you mean by "duplicate entries". I added 6 new customer fields, so assumed that each field needed to be listed separately in the tpl create account file as well as the tpl account edit file. The php quote in your post shows 2 different fields, namely "studentDORM" and "studentROOM", so not sure what was duplicated.
Looked so identical but you're right. They are different it would seem. :lookaroun
As far as subfolders in the extra_definitions folder, I saw that the Zen Cart Demo store has a "classic" folder in its extra_definitions folder, so assumed normal override rules and created the pogo folder with your create account and account edit files.
If you have an extra folder under the extra_definitions folder and switch other than classic and no results are appearing, then it has nothing to do with this MOD since overrides are detected as is. Unless you did not configured your language settings properly under the admin section - > tools, it should work without problems.
There weren't any if statements in your examples
Incorrect. My example for the create account template, let's take cellphone, is showed as is:
// We now set up an additional customer field for cellphones.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_cellphone") {
echo add_customers_fields_for_account_edit('customers_cellphone', 'zen_draw_input_field');
} // End of additional customers fields for cellphone.
You did not followed my instructions accordingly on this file.
#394 - I eliminated the admin/includes/languages/english/extra_
definitions/additional_customers_fields.php file, as you suggested. Unfortunately, no change - the new fields still don't appear in the account edit screen in the store.
Sorry, this wasn't for the admin. It was meant for the store-front. Under the admin, it must be used. Althought ... should of been more clearer about that on my last post.
Suspended
// We now set up an additional customer field for cellphones.
if (isset($account->fields['field_name']) && $account->fields['field_name'] == "customers_cellphone") {
echo add_customers_fields_for_account_edit('customers_c ellphone', 'zen_draw_input_field');
} // End of additional customers fields for cellphone.
Kind of odd ... I posted an example of the account edit page rather than the create account page yesterday. :blink:
You seem to be right - no if statements are involved from the create account template modules page. Good eye. :smartalec:
New Zenner
Thanks for making this mod. Your contribution is exactly what I'm looking for. However, the link does not seem to be working. When I go to 'http://www.storm.ca/~oracle/, I get the message "No longer available !" It appears that your bandwidth might be over the limit. Is there anywhere else I can get this mod?
New Zenner
I found it in the download section, it seems to be working now. Thanks! :cool: url: http://tinyurl.com/yr38hz
New Zenner
I don't mean to flood this thread, but I had a dilemma that I solved today and I'd like to share the solution here in case anyone else is having a similar issue:
Problem: new input fields do not show up in administrative backend (customers.php) when added via the mod unless the field has an assigned value in the database.
Solution: comment out the following lines in includes/extra_functions/additional_customers_fields_functions.php:
Line 68:
if (!empty($cInfo->$key)) {
```and the closing of the same if statement on line 75:
```php
} // End of if statement.
Props to Oracle to going out of his way to help everyone with his mod. :clap:
Now to make the form fields appear for new accounts... I'm sure that's documented here somewhere... I'll post again if I find anything that can save other zenners some time.
Fields marked required must be completed.
Tell staff why this post should be reviewed.