Zen Cart Logo
Forums / All Other Contributions/Addons / Additional Customers Fields

Additional Customers Fields

Locked

Views: 88,139

Results 61 to 80 of 491
This thread is locked. New replies are disabled.
30 May 2007, 13:07
#61
troo avatar

troo

New Zenner

Join Date:
Apr 2007
Location:
barnsley, south yorkshire, uk
Posts:
24
Plugin Contributions:
0

Additional Customers Fields

for the additional customer fields file in the extra definitions folder instead of dropdown menus i would like to have radio buttons, what would be the code for it?

Am i thinking it would be:

$additional_customers_fields_form_radio_title['customers_Breast_Feeding'] = array('Breast Feeding: ');

and for the content

$additional_customers_fields_form_radio_content['customers_Breast_Feeding'] = array(Yes, No);

could you let me know

30 May 2007, 13:41
#62
troo avatar

troo

New Zenner

Join Date:
Apr 2007
Location:
barnsley, south yorkshire, uk
Posts:
24
Plugin Contributions:
0

Re: Additional Customers Fields

**
when wanting to bring up the additional fields, having created an account i get this error message:

**Fatal error: Call to a member function MoveNext() on a non-object in C:\Program Files\xampp\htdocs\zen-cart\includes\templates\template_default\templates\tpl_modules_create_account.php on line **194

$account->MoveNext();

can you assist, please

**

30 May 2007, 14:52
#63
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

It is incredible the bad luck you're encounting with tables.

Do not use capitalized letters in your PHP tables, since it is case sensitive.

$additional_customers_fields_form_radio_title['customers_Breast_Feeding'] = array('Breast Feeding: ');

into:

$additional_customers_fields_form_radio_title['customers_breast_feeding'] = array('Breast Feeding: ');

and:

$additional_customers_fields_form_radio_content['customers_Breast_Feeding'] = array(Yes, No);

with:

$additional_customers_fields_form_radio_content['customers_breast_feeding'] = array(Yes, No);

Fatal error: Call to a member function MoveNext() on a non-object in C:\Program Files\xampp\htdocs\zen-cart\includes\templates\template_default\templates \tpl_modules_create_account.php on line 194

In order to assist, it would be appropriate to post the related code block between the while and end while loop (which the MoveNext() module is within).

30 May 2007, 15:10
#64
troo avatar

troo

New Zenner

Join Date:
Apr 2007
Location:
barnsley, south yorkshire, uk
Posts:
24
Plugin Contributions:
0

Re: Additional Customers Fields

ok, heres the code below for you to look at, thankyou for your assistance

<?php if (isset($account->fields['field_name'])) { ?>
       <fieldset>            
            <legend><?php echo ENTRY_ADDITIONAL_CUSTOMERS_FIELDS_TITLE; ?></legend>
            
            while (!$account->EOF) {                            
    if ($account->fields['field_name'] == "customers_Medicine_on_prescription") {            
         ?>           
         <label class="inputLabel" for="customers_Medicine_on_prescription"><?php echo ENTRY_CUSTOMERS_MEDICINE_ON_PRESCRIPTION_TITLE; ?></label>                        
        <?php echo zen_draw_textarea_field('customers_Medicine_on_prescription', '20', '3'); ?>
        <br class="clearBoth" />            
        <?php        
    } // End of additional customers fields for hobbies.        

// We now set up an additional customer field for ages.
if (ACCOUNT_MEDICINE_USED_BEFORE == 'true') {
?>
<?php echo zen_draw_radio_field('Medicine Used Before', 'y', $yes, 'id="medicine used before-yes"') . '<label class="radioButtonLabel" for="medicine used before-yes">' . YES . '</label>' . zen_draw_radio_field('medicine used before', 'n', $no, 'id="medicine used before-no"') . '<label class="radioButtonLabel" for="medicine used before-no">' . NO . '</label>' . (zen_not_null(ENTRY_MEDICINE_USED_BEFORE_TEXT) ? '<span class="alert">' . ENTRY_MEDICINE_USED_BEFORE_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php } if (ACCOUNT_TAKING_PRESCRIBED_MEDICINE == 'true') { ?>
<?php echo zen_draw_radio_field('Taking prescribed medicine ', 'y', $yes, 'id="taking_prescribed_medicine-yes"') . '<label class="radioButtonLabel" for="taking_prescribed_medicine-yes">' . YES . '</label>' . zen_draw_radio_field('taking_prescribed_medicine', 'n', $no, 'id="taking_prescribed_medicine-no"') . '<label class="radioButtonLabel" for=" change_to_details-no">' . NO . '</label>' . (zen_not_null(ENTRY_TAKING_PRESCRIBED_MEDICINE_TEXT) ? '<span class="alert">' . ENTRY_TAKING_PRESCRIBED_MEDICINE_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php

        ?>
        while (!$account->EOF) {                            
    if ($account->fields['field_name'] == "customers_Medicine_Details") {            
        ?>           
         <label class="inputLabel" for="customers_Medicine_Details"><?php echo ENTRY_CUSTOMERS_MEDICINE_DETAILS_TITLE; ?></label>                        
        <?php echo zen_draw_textarea_field('customers_Medicine_Details', '20', '3'); ?>
        <br class="clearBoth" />            
        <?php        
           
        ?>
        while (!$account->EOF) {                            
    if ($account->fields['field_name'] == "customers_Months_Pregnant") {            
        ?>           
         <label class="inputLabel" for="customers_Months_Pregnant"><?php echo ENTRY_CUSTOMERS_MONTHS_PREGNANT_TITLE; ?></label>                        
        <?php echo zen_draw_textarea_field('customers_Months_Pregnant', '20', '3'); ?>
        <br class="clearBoth" />            
        <?php        
          }
         if (ACCOUNT_BREAST_FEEDING == 'true') {
        ?>
        <?php echo zen_draw_radio_field('Breast_feeding ', 'y', $yes, 'id="Breast_Feeding-yes"') . '<label class="radioButtonLabel"         for="Breast_Feeding-yes">' . YES . '</label>' . zen_draw_radio_field('Breast_Feeding', 'n', $no, 'id="breast_Feeding-no"') . '<label class="radioButtonLabel" for=" Breast_Feeding-no">' . NO . '</label>' . (zen_not_null(ENTRY_BREAST_FEEDING_TEXT) ? '<span class="alert">' . ENTRY_BREAST_FEEDING_TEXT . '</span>': ''); ?>
<br class="clearBoth" /> <?php
        ?>
        while (!$account->EOF) {                            
    if ($account->fields['field_name'] == "customers_Ongoing_Medical_Conditions") {            
        ?>           
         <label class="inputLabel" for="customers_Ongoing_Medical_Conditions"><?php echo ENTRY_CUSTOMERS_ONGOING_MEDICAL_CONDITIONS_TITLE; ?></label>                        
        <?php echo zen_draw_textarea_field('customers_Ongoing_Medical_Conditions', '20', '3'); ?>
        <br class="clearBoth" />            
        <?php        
          
        ?>
        while (!$account->EOF) {                            
    if ($account->fields['field_name'] == "customers_Ongoing_Allergies") {            
        ?>          
         <label class="inputLabel" for="customers_Ongoing_Allergies"><?php echo ENTRY_CUSTOMERS_ONGOING_ALLERGIES_TITLE; ?></label>                        
        <?php echo zen_draw_textarea_field('customers_Ongoing_Allergies', '20', '3'); ?>
        <br class="clearBoth" />            
        <?php        
    } // End of additional customers fields for ages.  

// We now set up an additional customer field for cellphone.
if ($account->fields['field_name'] == "customers_cellphone") {
?>
<label class="inputLabel" for="customers_cellphone"><?php echo ENTRY_CUSTOMERS_CELLPHONE_TITLE; ?></label>
<?php echo zen_draw_input_field('customers_cellphone', '', zen_set_field_length(TABLE_CUSTOMERS, 'entry_customers_cellphone', '40') . ' id="customers_cellphone"'); ?>
<br class="clearBoth" />
<?php }// End of additional customers fields for cellphone. $account->MoveNext(); // End of while statement. // End of additional customers fields MOD. ?>

30 May 2007, 16:04
#65
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Easy problem. There cannot be multiple instances of while loops and end while loops. There can only be one that starts with the same variable and an ending while loop statement with one single braket at the end for ' all your additional customers fields '. :wink2:

Since this is not an obvious part, I will add this into my documentation later today.

31 May 2007, 11:07
#66
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Critical note & update:

A new version of this MOD has been done this morning. You may either re-download the package from my site (v1.12 - fully updated) or from the downloads section (which has not yet been updated unsurprisedly - so I'd recommend to stick with my site until the DEV team updates my latest upload). Very important fixes has been applied on this version.

01 Jun 2007, 02:57
#67
esugrue avatar

esugrue

Zen Follower

Join Date:
Jun 2004
Posts:
182
Plugin Contributions:
0

Re: Additional Customers Fields

Hi!

I have just tried to install this mod and when I go to:

Customers > Additional Customer Fields I get the message:

'The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.'

I tried in IE and after about 5 minutes it times out with the message:
Parse error: syntax error, unexpected $end in /public_html/store/admin/additional_customers_fields.php on line 138

I reuploaded that file etc but still the same problem.

Any ideas on what may be wrong.

Thanks
Ernie

01 Jun 2007, 07:13
#68
sadr1an1 avatar

sadr1an1

New Zenner

Join Date:
Mar 2007
Posts:
28
Plugin Contributions:
0

Re: Additional Customers Fields

Hello Oracle,
thank you again for helping me with my other problem.
Now i want to install this mod and i read all the docummentation and from this topic but i think i miss something. I installed the last package, i created a test field, i activted it, and i have edited additional_customers_fields.php to add my custom fields. I verified the database and everithing is ok but i cannot see the fields that i just created:
http://www.idshop.ro/login.html , same in admin->customers editor. What i'm missing?

01 Jun 2007, 11:18
#69
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Hi!

I have just tried to install this mod and when I go to:

Customers > Additional Customer Fields I get the message:

'The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.'

I tried in IE and after about 5 minutes it times out with the message:
Parse error: syntax error, unexpected $end in /public_html/store/admin/additional_customers_fields.php on line 138

I reuploaded that file etc but still the same problem.

Any ideas on what may be wrong.

Thanks
Ernie

This is a very odd problem. I cannot reproduce it. Can you justify precisely on where this problem occurs ? I will investigate this problem further.

Which version of PHP are you using ?
Which Zen-Cart version are you using ?
Which mySQL version are you using ?
(Note: These details can be found under your admin section - > tools - > server info link).

What i'm missing?

Did you used my example from my package (regarding the template file) based on the IF conditions that must be applied in order to successively show your additional customers fields from, either, the create account and / or the edit account page ?

Did you compared the readings under the modules files (create account and account edit) to select your additional customers fields ? Did you activated at least one field so that it could be shown from your admin's end ? :wink2:

01 Jun 2007, 18:13
#70
sadr1an1 avatar

sadr1an1

New Zenner

Join Date:
Mar 2007
Posts:
28
Plugin Contributions:
0

Re: Additional Customers Fields

One question, admin side,
i understand now what i have to modify on front end part, the overrides, but in the admin part except the language file i must modify elswhere? because i have created custom fields and i have activated them and in the customers table in mysql they are defined ok but i cannot see them when i edit a customer in my admin part. It is there a rectangle with "Additional customers Fields" title but nothing in it. Also when i press the update button it says
"1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE customers_id = 7' at line 1
in:
[UPDATE customers SET WHERE customers_id = 7]"
As you can see there is a problem with the sql command. What i'm missing?

01 Jun 2007, 18:40
#71
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

You probably mis-followed instructions for your includes/modules/pages/account_edit/header_php.php file. There shouldn't be any errors when updating as long as one additional customers fields is active.

In the mean time, the three questions from my post above were not answered yet.

01 Jun 2007, 23:03
#72
ali_peracha avatar

ali_peracha

New Zenner

Join Date:
Feb 2007
Posts:
50
Plugin Contributions:
0

Re: Additional Customers Fields

Hi,

Sorry to be late on my progress with the problems ive been facing... have been busy with other things.... anyway...

i reinstalled all the files of this MOD (v1.12) just today. Now, i need some help with the admin/includes/languages/english/extra_definitions/additional_customers_fields.php

I tried using the default/ demo values you have in there, but i don't see any fields on both the admin and the customer side.

On the [ Create new additional customers fields ] page, the type and size is still empty.

I tried using my own value but i cant see to get it to work. iIve read the install file over and over again but i know i'm still missing something.

Lets say if i need one additional customer field "Business Name" then what would i need to do? Can you tell me which files to edit?

Thanks,
AP

01 Jun 2007, 23:33
#73
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

The demo fields does not exists physically since it would require useless modifications to your TABLE_CUSTOMERS table. However, from your admin/includes/languages/english/extra_definitions/additional_customers_fields.php file, these fields are just examples so that you can change them into your own created fields name (also needs, at least, one additional customers fields to be activated from your customers - > add customers fields page).

As for the Create Additional Customers Fields page, are you sure to have uploaded the JS files (two files) under your admin/includes/javascript/mods/additional_customers_fields/english folder ? :wink2:

There is no files to edit others than the one under your admin's extra_definitions folder (in order to be shown under the admin's customers core file).

02 Jun 2007, 01:47
#74
ali_peracha avatar

ali_peracha

New Zenner

Join Date:
Feb 2007
Posts:
50
Plugin Contributions:
0

Re: Additional Customers Fields

TheOracle:

As for the Create Additional Customers Fields page, are you sure to have uploaded the JS files (two files) under your admin/includes/javascript/mods/additional_customers_fields/english folder ? :wink2:
core file).

okay as far as these two files are concerned, well no i had not uploaded it to the path you gave above. I just downloaded the MOD and uploaded as it was after i did the file merge etc. In your MOD the path is admin/javascript/mods/additional_customers_fields/english folder.... and the new path you gave me is admin/includes/javascript/mods/additional_customers_fields/english folder...please chk....

Secondly, now i do see the Type and Size and it does add an addiotional field, but i dont see the newly created field on both admin edit customer and new customer page... do i still need to manually create one field in the admin/includes/languages/english/extra_definitions/additional_customers_fields.php

e.g. $additional_customers_fields_form_input_title['customers_business_name'] = array('Business Name: ');

and also, what do you mean by also needs, at least, one additional customers fields to be activated from your customers - > add customers fields page

I actually have one field already activated as i have the wholesale mod installed. so right now on the main page for the MOD i see:

Name Index Options
customers_whole 1 (i activated this field)

Thanks,
AP

02 Jun 2007, 02:30
#75
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

okay as far as these two files are concerned, well no i had not uploaded it to the path you gave above. I just downloaded the MOD and uploaded as it was after i did the file merge etc. In your MOD the path is admin/javascript/mods/additional_customers_fields/english folder.... and the new path you gave me is admin/includes/javascript/mods/additional_customers_fields/english folder...please chk....

Confirmed. :shocking:

Package re-uploaded. Thanks for the catch and sorry about that. :smile:

do i still need to manually create one field in the admin/includes/languages/english/extra_definitions/additional_customers_fields.php

e.g. $additional_customers_fields_form_input_title['customers_business_name'] = array('Business Name: ');

Precisely. The arrays are considered like universal shortcut to avoid users to play into the admin/customer.php (which takes much longer and some skills to edit it). Meaning, each additional customers fields you will create must be added into the arrays as well. :wink2:

and also, what do you mean by also needs, at least, one additional customers fields to be activated from your customers - > add customers fields page

I actually have one field already activated as i have the wholesale mod installed. so right now on the main page for the MOD i see:

Name Index Options
customers_whole 1 (i activated this field)

This means that if you decide to deactivate all fields, your core field's output (not physically but on the page only) will also be affected. Activate at least one additional field so that the while loop statement doesn't get affected in your template file. :smile:

If you already activated the field and shows as is from your store-front page, then you did exacly the steps that was required to do. Only thing for you to do is to assure that the arrays matches the exact same name as your physical created name from the admin section. :smile:

02 Jun 2007, 09:02
#76
sadr1an1 avatar

sadr1an1

New Zenner

Join Date:
Mar 2007
Posts:
28
Plugin Contributions:
0

Re: Additional Customers Fields

I have managed to make it work on the customers part, but i had to make some modiffications:

in includes\modules\your_template\create_account.php
i have to add "," because tha sql command was incomplet:
line 309:

$sql = "update " . TABLE_CUSTOMERS . "
set customers_default_address_id = '" . (int)$address_id . "'," . $additional_sql . "
where customers_id = '" . (int)$_SESSION['customer_id'] . "'";

and in the includes\templates\your_template\templates\tpl_modules_create_account.php
i have to add a variable $temp because the fields repeated themselves. I don't know why but in the edit form is working ok. This is my modification:
around line 123:

// Note: The while loop below shall remain unique for 'All your additional customers fields you will add with the variable: '$account' .
$temp = "";
while (!$account->EOF) {

    if ($account->fields['field_name'] == "customers_buletin" && $temp != $account->fields['field_name']) {            
        ?>            
        <label class="inputLabel" for="customers_buletin"><?php echo ENTRY_CUSTOMERS_BULETIN_TITLE; ?></label>                 <?php echo zen_draw_input_field('customers_buletin', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_buletin', '40') . ' id="customers_buletin"'); ?>
        <br class="clearBoth" />            
        <?php        
    }

.............................................................

I used the files in the lastest of your pack, if you can look at it maybe you can make some modiffication.

02 Jun 2007, 09:23
#77
sadr1an1 avatar

sadr1an1

New Zenner

Join Date:
Mar 2007
Posts:
28
Plugin Contributions:
0

Re: Additional Customers Fields

I'm, now trying to mage the admin part working, after i have some customers registrations with additional customers fields filled. When i try to edit one of the customers i receive this error:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in admin/customers.php on line 1209

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in admin/customers.php on line 1209

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in admin/customers.php on line 1211

Warning: reset() [function.reset]: Passed variable is not an array or object in admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in admin/includes/classes/object_info.php on line 30

I have followed the steps and i have modified admin\includes\extra_configures\additional_customers_fields.php setting up the arrays for each field.

02 Jun 2007, 10:44
#78
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

Which version of PHP are you using ?
Which Zen-Cart version are you using ?
Which mySQL version are you using ?
(Note: These details can be found under your admin section - > tools - > server info link).

Please answer those questions. You are requesting assistance and it is not obvious to make any corrections without having those details covered.

Thanks.

02 Jun 2007, 15:10
#79
sadr1an1 avatar

sadr1an1

New Zenner

Join Date:
Mar 2007
Posts:
28
Plugin Contributions:
0

Re: Additional Customers Fields

Sorry for that i forgot to mention,
I'm using:
Server OS: Linux server14.whmpanels.com 2.6.9-42.0.8.ELsmp #1 SMP Tue Jan 30 12:33:47 EST 2007 i686
PHP Version: 5.2.0 (Zend: 2.2.0)
Database: MySQL 4.1.21-standard-log
HTTP Server: Apache/1.3.37 (Unix) PHP/5.2.0 mod_auth_passthrough/1.8 mod_log_bytes/1.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
Zen Cart: v1.3.7 (Fresh Installation)

02 Jun 2007, 15:21
#80
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Additional Customers Fields

That's what I thought. You seem to be using PHP v5.2x. I'm using PHP v4.4x. I'm also using mySQL v4.1 and Zen-Cart v1.3.7. I can only determine that this is a PHP issue (since v5.2 version has already been reported as problematic from other topics).

Did you installed the patches ? If so, do you have an FTP alternate server account I could use so that I could patch this live in order to make this MOD compatible with PHP v4 + v5 ? If you do, you may email me the infos (email from installation package). If not, install the patches (if you haven't already done so) and if it still doesn't work, then until I install PHP v5.x, I will not be able to fix out this particular problem due to incompatible PHP transcription comparing to PHP v4.