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

Additional Customers Fields

Locked

Views: 88,142

Results 221 to 240 of 491
This thread is locked. New replies are disabled.
14 Jun 2007, 4:48 AM
#221
theoracle avatar

theoracle

Suspended

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

Additional Customers Fields

MySQL about 4.4

This could be one of the cause for my release though since my MOD has been tested under mySQL v4.1 only.

As for v3.1.7 - doesn't exist yet. :D
I think you meant: v1.3.7 ? :cool:

14 Jun 2007, 4:51 AM
#222
beilana avatar

beilana

New Zenner

Join Date:
Apr 2006
Location:
Phoenix, AZ
Posts:
84
Plugin Contributions:
0

Re: Additional Customers Fields

You got me - Zen Cart v1.3.7

Keep up the good work.

You are one of the best writers we have.

14 Jun 2007, 4:53 AM
#223
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Thanks - I do appreciate this comment. :smartalec:

14 Jun 2007, 12:20 PM
#224
maximiliano avatar

maximiliano

New Zenner

Join Date:
May 2007
Posts:
8
Plugin Contributions:
0

Re: Additional Customers Fields

Helo, I like to know how to make or modify a field in custumer login form to textarea.
I dont lnow if this is the correct post, sorry :smile:.

Thnx

14 Jun 2007, 12:54 PM
#225
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

In your includes/templates/<your_template>/templates/tpl_modules_create_account.php file (as stated from my example), you can add it like this:

if (isset($account->fields['field_name']) && $account->fields['field_name'] == "your_field_name") {
add_customers_fields_for_create_account('your_field_name', 'zen_draw_textarea_field');
} // End of if statement.

Simply change your_field_name entries from above with your created (and activated) field name. :wink2:

Follow my template example on how and where these three lines should be added.

14 Jun 2007, 1:05 PM
#226
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Additional note: Make sure to add your fields definition under your includes/languages/<your_language>/extra_definitions/additional_customers_fields_create_account.php file in the mean time. :wink2:

14 Jun 2007, 2:39 PM
#227
maximiliano avatar

maximiliano

New Zenner

Join Date:
May 2007
Posts:
8
Plugin Contributions:
0

Re: Additional Customers Fields

Helo, I added this lines in includes/templates/MY_TMP/templates/tpl_modules_create_account.php

<?PHP if (isset($account->fields['customers_test']) && $account->fields['customers_test'] == "test") { add_customers_fields_for_create_account('test', 'zen_draw_textarea_field'); } // End of if statement. ?>

and i dont see the new field in the form... I have installed your contribution and i create and activate the new field.

:lamo:

please help :smile:

14 Jun 2007, 2:52 PM
#228
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

$account->fields['field_name'] is a true static field that should NOT be changed.

Since your field is called test (also assuming you activated it after creating it from the admin), this is the way to do it:

if (isset($account->fields['field_name']) && $account->fields['field_name'] == "test") {
add_customers_fields_for_create_account('test', 'zen_draw_textarea_field');
} // End of if statement.

:wink2:

Again, you also need to set the array from your extra_definitions folder (as mentionned above + from my upgrade and changelog documentation).

14 Jun 2007, 3:10 PM
#229
phillipmadsen avatar

phillipmadsen

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Additional Customers Fields

I KEEP GETTING THIS ERROR AND DONT KNOW HOW TO FIX PLEASE HELP IF YOU CAN. SORRY IM NEW TO PHP

EVERY TIME I TRY TO GO TO MY SHOPPING CART IT SAYS THIS . I ASSUME IT IS TRYING TO CREATE AND ACCOUNT

Parse error: parse error, unexpected ';', expecting ')' in /homepages/26/d205676491/htdocs/store/includes/modules/create_account.php on line **260

HELP IF YOU CAN :blink:
**

14 Jun 2007, 3:15 PM
#230
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Parse error: parse error, unexpected ';', expecting ')' in /homepages/26/d205676491/htdocs/store/includes/modules/create_account.php on line 260

Easy problem to resolve. It would seem you have compared my readings with yours by probably replacing the old array with my new array but ended up with two ';' at the end of that block.

Ex:

);;

You just need to remove the last one from your includes/modules/<your_template>/create_account.php file. :wink2:

By the way, there's no need to use capitalized letters on this topic . . .

14 Jun 2007, 3:38 PM
#231
phillipmadsen avatar

phillipmadsen

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Additional Customers Fields

Sorry i sometimes forget about caps. i looked at the code and it was the way it is supposed to be. i will cut and past it on her from lines 247 to 264.

$sql_data_array = array('moderators_level' => 0,
'customers_firstname' => $firstname,
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
); :no:

if ((CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '')) $sql_data_array['customers_referral'] = $customers_referral;
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']));
14 Jun 2007, 3:45 PM
#232
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Even worst - the problem is here:

$sql_data_array = array('moderators_level' => 0,
'customers_firstname' => $firstname,
$sql_data_array = array('customers_firstname' => $firstname,

This is NOT what has been instructed from the upgrade guide.

Replace with:

$sql_data_array = array('moderators_level' => 1,
'customers_firstname' => $firstname,

(Note: I also just replaced the 0 to 1 in the mean time since 0 is not a valid case for this one. I have just updated my package on my site on this one. All SQL fields that contains 0 from your TABLE_CUSTOMERS 0 for the moderators_level fields MUST be replaced with 1 as a value. My apologize for this slight bug though).

14 Jun 2007, 4:13 PM
#233
phillipmadsen avatar

phillipmadsen

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Additional Customers Fields

i appreciate your help thanks. that almost worked now im getting this error:clap:

$sql = "insert into " . TABLE_CUSTOMERS_INFO . "
(customers_info_id, customers_info_number_of_logons,
customers_info_date_account_created)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";
(customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";

is it the zero again this error is on line 322

thanks

14 Jun 2007, 4:39 PM
#234
phillipmadsen avatar

phillipmadsen

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Additional Customers Fields

Any idea what is causing the new problem above. i have tried everything i can think of and got nowhere. once again any help is extremly appreciated.
:mellow:
thanks

14 Jun 2007, 5:08 PM
#235
maximiliano avatar

maximiliano

New Zenner

Join Date:
May 2007
Posts:
8
Plugin Contributions:
0

Re: Additional Customers Fields

[[ Again, you also need to set the array from your extra_definitions folder (as mentionned above + from my upgrade and changelog documentation). ]]

How can i do This?? , i think that this must be the problem

14 Jun 2007, 5:18 PM
#236
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

$sql = "insert into " . TABLE_CUSTOMERS_INFO . "
(customers_info_id, customers_info_number_of_logons,
customers_info_date_account_created)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";
(customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";

? :blink:

There should only be one set of injection for this block ...

Replace with:

$sql = "insert into " . TABLE_CUSTOMERS_INFO . "
           (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
            values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";

How can i do This?? , i think that this must be the problem

By ... looking into the file itself ? The four form type examples are, either, in the additional_customers_fields_create_account.php and additional_customers_fields_account_edit.php file . . .

Simply use the textarea one by stating your own field inside key block ...

Any idea what is causing the new problem above. i have tried everything i can think of and got nowhere. once again any help is extremly appreciated.

Please take note that I cannot be in front of my monitor 24 hours a day. We all have lives as I need to be elsewhere sometimes. Replies will be return to you as quickly as I can. So far, I don't think this is an issue.

Thanks.

15 Jun 2007, 4:00 AM
#237
rbepple avatar

rbepple

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

Re: Additional Customers Fields

Ok, I think I am about done with this mod. I have completely reload Zen Cart 4 times now because when I install the files necessary and compare the other files and add the lines between //Additional Customer Fields and //End of Additional Customer Fields, it goes tilt. I have found I switch the template back from mine to the Classic(default) and the user side works but I get this error on the admin side when I access customers:

1054 Unknown column 'c.customers_default_address_id' in 'on clause'
in:
[select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, c.customers_email_format, c.customers_group_pricing, c.customers_authorization, c.customers_referral, ac.field_name, ac.field_status from customers c, customers_additional ac left join address_book a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '11']
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.

15 Jun 2007, 4:08 AM
#238
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Restore your TABLE_CUSTOMERS table from your backup. This should resolve the issue.

15 Jun 2007, 3:19 PM
#239
rbepple avatar

rbepple

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

Re: Additional Customers Fields

OK i restored TABLE_CUSTOMERS and I still get the message so I reloaded Zen Cart and it works again. I have uploaded my template and it works. I uploaded the files told to and compared and updated the other files in this mod. I ran the SQL in the Install SQL Patch. I haven't added any fields yet and it has gone tilt. I am getting this error on the customer side:

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 = '13'' at line 3
in:
[update customers set customers_default_address_id = '13', where customers_id = '13']

What am I doing wrong? Am I missing a step? I also am not sure about the moderators_level and what that is.

15 Jun 2007, 3:20 PM
#240
rbepple avatar

rbepple

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

Re: Additional Customers Fields

P.S. I am using MySQL 5 if that is any help.