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

Additional Customers Fields

Locked

Views: 88,139

Results 41 to 60 of 491
This thread is locked. New replies are disabled.
28 May 2007, 23:38
#41
theoracle avatar

theoracle

Suspended

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

Additional Customers Fields

Lets fix this.

In your admin/additional_customers_fields.php file,

move:

  //----------------------------------------------------------------------------------
  //--- No customers are allowed (can't take any chances) ---
  //----------------------------------------------------------------------------------  
  if (!$_SESSION['admin_id']) {
      $messageStack->add_session(ENTRY_ADDITIONAL_CUSTOMERS_FIELDS_UNAUTHORIZED_ACCESS, 'warning');                       
      zen_redirect(zen_href_link(FILENAME_ADDITIONAL_CUSTOMERS_FIELDS, '', 'NONSSL'));
  } // End of if statement.
  ?>

Then, find:

<?php require(DIR_WS_INCLUDES . 'header.php');

replace with:

<?php require(DIR_WS_INCLUDES . 'header.php');
  //----------------------------------------------------------------------------------
  //--- No customers are allowed (can't take any chances) ---
  //----------------------------------------------------------------------------------  
  if (!$_SESSION['admin_id']) {
      $messageStack->add_session(ENTRY_ADDITIONAL_CUSTOMERS_FIELDS_UNAUTHORIZED_ACCESS, 'warning');                       
      zen_redirect(zen_href_link(FILENAME_ADDITIONAL_CUSTOMERS_FIELDS, '', 'NONSSL'));
  } // End of if statement.
  ?>

Should work now.

29 May 2007, 09:57
#42
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

i have editied the tpl_modules_create_account and tpl_modules_account_edit files to add my additional fields i get this error message

Parse error: syntax error, unexpected $end in C:\Program Files\xampp\htdocs\zen-cart\includes\templates\template_default\templates\tpl_modules_create_account.php on line **327

can anyone help, i`m stuck:frusty:
**

29 May 2007, 11:14
#43
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

This error message means that you're missing a ending bracket (probably from an IF condition) at the end of the condition you were applying. :wink2:

29 May 2007, 12:19
#44
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

Thanks for the advice, i think ive got it also i get a message when i have added to additional customer fields.php the message error i get is

Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\zen-cart\admin\includes\languages\english\extra_definitions\additional_customers_fields.php on line **99

i have also added to english.php to define the fields. can anyone help i`m stuck yet again:frusty:
**

29 May 2007, 12:42
#45
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Please post between line 95 and 105 of your extra_definitions/additional_customers_fields.php file.

I have also added to english.php to define the fields.

That file must NOT be edited. Please remain with the extra_definitions folder (overrides).

can anyone help i`m stuck yet again

The 'anyone' shall be addressed to me by the way since I'm the author of this MOD.

29 May 2007, 12:48
#46
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

thank you for the advice and i will address you instead of putting anyone.

29 May 2007, 13:22
#47
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

as posted previously i have edited the additional customer fields.php the message error i get is

Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\zen-cart\admin\includes\languages\english\extra_defini tions\additional_customers_fields.php on line **95

can the oracle see where i am going wrong
**

29 May 2007, 13:43
#48
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Please post the whole file's content (between PHP bbcode tags) so that I could check this out more closely.

29 May 2007, 13:48
#49
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

here is the full code

<?php //----------------------------------------------------------------------------------------------------------- //--- Additional customers fields MOD ------------------------------------------------------ //---------------------------------------------------------------------------------------------------------- // --- Coded by TheOracle on May 9, 2007. ---------------------------------------------- // --- Support: <http://www.zen-cart.com/forum> ------------------------------------------ // --- Designed for Zen-Cart v1.3x versions ----------------------------------------------- //---------------------------------------------------------------------------------------------------------- // If you like this MOD, please send a donation to: [email protected] . -- //--------------------------------------------------------------------------------------------------------- define('BOX_CUSTOMERS_ADDITIONAL_CUSTOMERS_FIELDS', 'Add Customers Fields'); // Additional Customers Fields - Form Type Table Title For Whole Additional Window. define('ADDITIONAL_CUSTOMERS_FIELDS_FORM_TITLE', 'Additional Customers Fields'); //========================================================================================================= // Additional Customers Fields - Form Type Table Structure (Input text fields) // Here's out it works in HTML version for the input text: // - <input type="text" name="customers_hobbies" value="your content"> // - <input type="text" name="customers_age" value="your content"> // - <input type="text" name="customers_cellphone" value="your content"> // Imagine; almost four years has passed and all the pain we had to push ourselves into. // This new way is a way for your freedom. All you need to do is to enter "one" title name for // each additional customers fields you have created from the MOD. // Remember, a constance of 'two additional customers fields' is needed. // You can see some example below. As you can see, for the input type, there are no content. // Of course not, the content is being gathered from the database since no options are required // in order to ask customers to fill their content. The title should suffise in this case (the same for the textarea type). //------------------------------------------------------------------------- // Here's a cheap preview: // Title | Content // ------------------------------------------------------------------------ // From your admin/customers.php file, before this MOD was ever built, additional fields required to be // added manually into the file as expertise were required in order to accomplish the task without // any damages involved. // Try it here and time yourself to see how fast you can implement new fields - starting from this point. // Array functionality: // As for the other fields type - // The way arrays work, again, one title only. As for the content, you can add unlimited texts and values inside. // Ex: ("test1", "test2", "test3") and so on. Remember to add your title first. // In your admin/customers.php file, the results will output like this if you choose the pull down list type: // Title | test1 // test2 // test3 // As for your radio title, it will output like this: // Title | <button> test1 <button> test2 <button> test3 // If you have read this text until here, then you should understand how it works. If not, you can always request support // from the author for additional help. // 1st note: If you're worried about having your fields checked by default, don't worry - it is already implemented in the MOD. // 2nd note: Do NOT add the additional customers name field twice on two different form types. Otherwise, you might alter // your specific customer's options. // 3rd note: There are no checkboxes options inside this MOD yet. Reason: Checkboxes are meant for specific actions. // It cannot be determined on what exacly you'd like to do with these checkboxes (ex: delete, update, select, checked without validations ect ...). // Below are few examples on how it works. You can customize these names into the fields name you created - the way you like them to be. // Good luck ! //========================================================================================================= //$additional_customers_fields_form_input_title['customers_hobbies'] = array('Hobbies: '); //$additional_customers_fields_form_input_title['customers_age'] = array('Age: '); //$additional_customers_fields_form_input_title['customers_cellphone'] = array('Cellphone: '); // Additional Customers Fields - Form Type Table Structure (Textarea fields) //$additional_customers_fields_form_textarea_title['customers_hobbies'] = array('Hobbies: '); //$additional_customers_fields_form_textarea_title['customers_age'] = array('Age: '); //$additional_customers_fields_form_textarea_title['customers_cellphone'] = array('Cellphone: '); // Additional Customers Fields - Form Type Table Structure (Select fields - title) //$additional_customers_fields_form_pull_down_title['customers_hobbies'] = array('Hobbies: '); //$additional_customers_fields_form_pull_down_title['customers_age'] = array('Age: '); //$additional_customers_fields_form_pull_down_title['customers_cellphone'] = array('Cellphone: '); //$additional_customers_fields_form_pull_down_content['customers_hobbies'] = array("test1"); //$additional_customers_fields_form_pull_down_content['customers_age'] = array(18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99); //$additional_customers_fields_form_pull_down_content['customers_cellphone'] = array("test3"); $additional_customers_fields_form_input_title['customers_Medicine_on_prescription'] = array('Medicine on Prescription: ') $additional_customers_fields_form_input_title['customers_Medicine_Details'] = array('If so, please give details: '); $additional_customers_fields_form_input_title['customers_Months_Pregnant'] = array('If you are pregant, how many months are you?: '); $additional_customers_fields_form_input_title['customers_Ongoing_Medical_Conditions '] = array('Please tell us about your medical conditions: '); $additional_customers_fields_form_input_title['customers_Ongoing_Allergies '] = array('Please list your allergies, if any?: '); $additional_customers_fields_form_radio_title['customers_Medicine_used_before '] = array('Have you used this medicine before: '); $additional_customers_fields_form_radio_title['customers_Taking_prescribed_medicine'] = array('Are you taking any prescribed medicines?:'); $additional_customers_fields_form_radio_title['customers_Breast_Feeding'] = array('If you have had a baby, are you breast feeding?: '); $additional_customers_fields_form_radio_content['customers_Medicine_used_before'] = array(Yes, No); $additional_customers_fields_form_radio_content['customers_Taking_prescribed_medicine'] = array(Yes, No); $additional_customers_fields_form_radio_content['customers_Breast_Feeding'] = array(Yes, No); ?>
29 May 2007, 13:56
#50
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Make sure NOT to use spaces within your tables.

Example:

//$additional_customers_fields_form_radio_content['customers_hobbies <spaces>']

Should rather be like this - period:

//$additional_customers_fields_form_radio_content['customers_hobbies']

(Note: This applys within all your tables - no matter if it's title or content).

29 May 2007, 14:26
#51
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

i have eliminated the spaces as stated but still get the error message still. What does the oracle suggest.

29 May 2007, 15:03
#52
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

i have taken out the additional customer fields created in the last post, to get back into zen cart control panel. When testing my shop, the customer registration form is showing an error message

Parse error: syntax error, unexpected $end in C:\Program Files\xampp\htdocs\zen-cart\includes\templates\template_default\templates\tpl_modules_create_account.php on line **286

can the oracle assist, with this query. As i am very very stuck:frusty:
**

29 May 2007, 15:50
#53
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Parse error: syntax error, unexpected $end

Now, when you see this particular error message, it means a missing bracket statement at the end of your particular condition. You seem to experience difficulties to work with PHP or with Zen-Cart period. Perhaps you should consider someone else to make the installation & integration for you.

29 May 2007, 17:28
#54
knighs2 avatar

knighs2

New Zenner

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

Re: Additional Customers Fields

re below and associated fix
Posted by: TheOracle On: 29th May 2007 12:38 AM
1)
It would seem this feature cannot verify for any existent files, since the verification module could not be found. Perhaps you forgot to upload the function file that goes to extra_functions directory ?
2)
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/1body1life.biz/public_html/Shop/admin/additional_customers_fields.php:33) in /home/sites/1body1life.biz/public_html/Shop/admin/includes/functions/general.php on line 34

I tried that and it say the same only now its
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/1body1life.biz/public_html/Shop/admin/additional_customers_fields.php:26) in /home/sites/1body1life.biz/public_html/Shop/admin/includes/functions/general.php on line 34

line 26 is <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>

and line 34 in the general file is header('Location: ' . $url);

**In the folder i downloaded the additional_customers_fileds_funcations.php is within admin\functions\extra_functions if i move it to admin\includes\functions\extra_functions **
** error no 2 goes and i see **
Additional Customers Fields - Created additional fields There are currently no new additional customers fields created/imported into the listing table. If you do have some additional customers fields to add, try-out the: Create new additional customers fields link above. Number of additional customers fields found: 0 Which i am assuming is correct ??? but i still get the below

It would seem this feature cannot verify for any existent files, since the verification module could not be found. Perhaps you forgot to upload the function file that goes to extra_functions directory ?

Could the directory struture of the files be wrong that i down loaded ? Ive checked several times now and all files are in the same ones as the download

Thanks

29 May 2007, 17:52
#55
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

It is very hard to read your report when no quotes are being used. However, regarding the function files, which PHP and mySQL version are you using and other which type of OS web server is your web site running ? I cannot reproduce this problem as you don't seem to be the only one encountering this problem . . .

29 May 2007, 22:05
#56
knighs2 avatar

knighs2

New Zenner

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

Re: Additional Customers Fields

TheOracle:

It is very hard to read your report when no quotes are being used. However, regarding the function files, which PHP and mySQL version are you using and other which type of OS web server is your web site running ? I cannot reproduce this problem as you don't seem to be the only one encountering this problem . . .

sorry im new to forums too ! Server info etc below.

**Server Host: **web26.extendcp.co.uk (127.0.0.1) **Database Host: **https://www.1body1life.biz (82.110.105.26) **Server OS: **Linux 2.6.9-34.ELsmp **Database: **MySQL 5.0.26-standard **Server Date: **29/05/2007 22:59:51 **Database Date: **29/05/2007 22:59:51 **Server Up Time: **22:59:51 up 127 days, 15:45, 0 users, load average: 4.54, 4.07, 4.37
**PHP Version: **4.4.4 (Zend: 1.3.0)
**HTTP Server: **Apache/2.0.55 (Red Hat)

if i move additional_customers_fileds_funcations.php from admin\functions\extra_functions as it is set out in the download folder and move it to:
admin\includes\functions\extra_functions then it seems to work or at least im assuming as the errors have gone. So i dont know if the file structure was wrong in the file download but im sure others would have had the same issue ? unless most people realised and just moved it ?


Anyway its working now YAY (i have issues with the add customer fields but ill find another thread for that)


Thanks for your patience anyway

29 May 2007, 23:21
#57
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Update:

I found the issue as it is not what has been mentionned above. It was the function itself that had little issues. I have uploaded Zen-Cart to another server as it would of seem to return the same header error message.

What has been mentionned above is that I did not set the functions directory from the right folder before zipping the file. The functions directory is supposed to be inside the includes folder. Corrections has also been made regarding this issue. :smile:

Package ready. :cool:

29 May 2007, 23:36
#58
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

i have issues with the add customer fields but ill find another thread for that

All encounted issues with this MOD shall remain under this topic. It will be easier for others in case they'd encounter the same issues rather than searching for numerous topics on the same subject.

30 May 2007, 09:59
#59
troo avatar

troo

New Zenner

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

Re: Additional Customers Fields

thanks for your recent comments, i have looked through my code and there were multiple errors and have rectified those, **going through rest of it to make sure there arent any more .:clap:

i feel that i am not a million miles away from finishing the install and wont let it beat me. :clap:
**

30 May 2007, 12:10
#60
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

You shouldn't encounter anymore issues since these last fixes. :cool: