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

Additional Customers Fields

Locked

Views: 88,139

Results 81 to 100 of 491
This thread is locked. New replies are disabled.
2 Jun 2007, 3:28 PM
#81
sadr1an1 avatar

sadr1an1

New Zenner

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

Additional Customers Fields

Thank you for the quick answer, meenwhile i saw other topics with php v5 problems. I will try to make the modification myself and i will share it with you as soon as i finish. I'm happy that i managed to make the customers front end working and i can get live my shop :smile:.

2 Jun 2007, 6:51 PM
#82
sadr1an1 avatar

sadr1an1

New Zenner

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

Re: Additional Customers Fields

It was very easy i just had to make the casts :)
at line 1209:

$customer_info = array_merge((array)$country->fields, (array)$info->fields, $reviews->fields);

Now i have another isue, when a custom field is not filled up by customer it doesn't show the corresponding field in the admin side.

2 Jun 2007, 7:02 PM
#83
sadr1an1 avatar

sadr1an1

New Zenner

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

Re: Additional Customers Fields

For the previous post i have to make the moddification because if one of the clients don't fill the fields because i don't wan't them to make it required, when we telephone them for cheching the command maybe we obtain more information and we want to retain them.
So from line 837 I erased the conndition:

for ($i = 1; $i <= sizeof($table_fields); $i++) {
?>
<tr>
<td class="main"><?php echo $val1; ?></td>
<td class="main"><?php echo zen_draw_input_field($key, $cInfo->$key, zen_set_field_length (TABLE_CUSTOMERS, $key, 15)); ?></td> </tr>
<?php
break;
} // End of for statement.

Now the mod is working perfectly for me. Thank you Oracle:clap:

2 Jun 2007, 7:09 PM
#84
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Take note that if you remove this block, you will no longer be able to see the input type form period (even when creating your arrays). Are you sure this is what you were looking for to do ?

As for not showing the content when customers does not fill out anything at all from his end, it was intentionally done this way. Are you looking for to remove this part of the condition only ? If so, I could simply give you the proper modifications for it as it is even more easy. :cool:

2 Jun 2007, 7:26 PM
#85
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

aaargh... this is killing me.... you guys are way ahead... and look at me... i can't even make this to show the fields i just created.

im doing exactly as the instructions and even then its not working for me...

here is what im doing...

  1. admin/includes/languages/english/extra_definitions/additional_customers_fields.php

$additional_customers_fields_form_input_title['customers_whole'] = array('Wholesale Level: ');

$additional_customers_fields_form_input_title['customers_wholesale_id'] = array('Tax ID: ');

  1. [Import customers fields]

customers_whole 1 imported

  1. [ Create new additional customers fields ]

Name Type Size Attribute (if applicable) Default (if applicable)
customers_whole text ----- -----------
customers_wholesale_id text ----- -----------

  1. Additional Customers fields Main Page

Name Index Options
customers_whole 1 enabled
customers_wholesale_id 2 enabled

Number of additional customers fields found: 2

  1. After doing this i still can't see any thing on both the customer's as well as admin's side.... it just has a block that says 'Additional Customers Fields'

What am i missing here?

AP

2 Jun 2007, 7:27 PM
#86
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Or you meant that you only removed the:

if (!empty($cInfo->$key)) {

and:

} // End of if statement.

lines from that block ? If so, this only seem to happend with PHP v5.2x since it works great with PHP v4.4x ... :huh:

Odd if it's the case. Too bad I can't confirm this since, again, I do not use PHP v5.2x unfortunitely.

2 Jun 2007, 7:32 PM
#87
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

What am i missing here?

Simple. Check your number 2 step again (you posted above). You have decided to create both of these fields as textarea fields. Meaning, you are not using the right arrays structure in order to be shown correctly under your customer's form end and under the admin's customers page. :wink2:

Technicly, change:

$additional_customers_fields_form_input_title['customers_whole'] = array('Wholesale Level: ');

$additional_customers_fields_form_input_title['customers_wholesale_id'] = array('Tax ID: ');

with:

$additional_customers_fields_form_textarea_title['customers_whole'] = array('Wholesale Level: ');

$additional_customers_fields_form_textarea_title['customers_wholesale_id'] = array('Tax ID: ');

Additional note: Make sure that your fields contains something inside (logically). Otherwise, it will NOT be shown since it would be quite useless to see empty fields from customers if the customers themselves wouldn't want to fill them out right ? :wink2:

It's also a good way to save out ressources on our websites. :cool:

As for the customer's end, if they cannot see it either, it means that you're not using the correct condition statement related under your template files 'or' did not incorporated my modules correctly under your overrides modules files (as shown from my package originally).

2 Jun 2007, 8:16 PM
#88
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

sighs:frusty:

its still not working... i uploaded all the files again, made the changes that you suggested, followed the steps over and over again, but i still dont see any fields on the customer page as as well as the admin page...

i suppose i'll just have to let it go :cry:

2 Jun 2007, 8:39 PM
#89
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Let's do a little test here. In your includes/modules/pages/<your_template>/account_edit.php file,

right below this line:

$account = $db->Execute($account_query);

(and asusming you included the $additional_sql variable into the SQL SELECT statement as instructed),

paste the following command:

echo $account->fields['customers_whole'];

(assuming that field still exists too).

Then, log in into your test account. Go to your account info page and tell me if you see something at the top of your page.

2 Jun 2007, 8:53 PM
#90
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Sorry, little correction here:

includes/modules/pages/<your_template>/account_edit.php file,

for:

includes/modules/pages/<your_template>/account_edit/header_php.php file,

2 Jun 2007, 9:17 PM
#91
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

thanks for the path... i was actually about to submit a post confirming about the path:)

btw... is pages before <your_template> or after?

2 Jun 2007, 9:31 PM
#92
sadr1an1 avatar

sadr1an1

New Zenner

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

Re: Additional Customers Fields

Yes, strange things with php 5 but i'm happy that i fully tested and working. Now, i realy think the docummentation is a little bit to hard to understand and i will be happy to make a litle tutorial with steps for setting it right, exactly how i make it to work.

Steps i followed for a fresh installation:
Step 1:
Upload the files from the archive in the corresponding folder path of the zendcard structure
Step 2:
Go to Admin, and from there Customers->Add Customers Fields
Create a new custom field pressing the link [ Create new additional customers fields ].
For example i will define customers_car with type varchar with size 96
Step 3:
Edit admin/includes/languages/english/extra_definitions/additional_customers_fields.php and add your custom field defined on Step 2.
For example: I add the line above and comment the exapmle lines

$additional_customers_fields_form_input_title['customers_car'] = array('Car type: ');

Step 4:
Edit includes/languages/english/extra_definitions/additional_customers_fields.php and add your custom field defined
For example: I add the line above and comment the exapmle lines

define('ENTRY_CUSTOMERS_CAR_TITLE', 'Car type: ');

Step 5:
Edit includes/templates/idshop/templates/tpl_modules_create_account.php and add your custom field defined
For example: I add the block above and comment the exapmle blocks

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

Step 6:
Edit includes/templates/idshop/templates/tpl_account_edit_default.php and add your custom field defined
For example: I add the block above and comment the exapmle blocks

if ($account->fields['field_name'] == "customers_car" && $account->fields['field_status'] == 2) {
?>
<label class="inputLabel" for="customers_car"><?php echo ENTRY_CUSTOMERS_CAR_TITLE; ?></label>
<?php echo zen_draw_input_field('customers_car', $account->fields['customers_car'], 'id="customers_car"'); ?>
<br class="clearBoth" />
<?php
}

That's all :)

Now, if you use PHP 5 there are few modifiication that you must take, if you look at my posts above you will notice them.

2 Jun 2007, 10:19 PM
#93
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

btw... is pages before <your_template> or after?

According to the wiki documentation, it's after. I made a mistake in the package as I will make the corrections in a couple of mins.

@sadr1an1:

Thanks for the patch for PHP5. If you can confirm that you can either disable / enable this example field from the admin section and can see it in action from the store-front, then it will definitely help others who encounters the same issues with PHP5 in the future. :wink2:

2 Jun 2007, 10:27 PM
#94
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Modules overrides documentation path here:

http://www.zen-cart.com/wiki/index.php/Pages

as I have just refreshed the ZIP file for this MOD on my site. :smile:

2 Jun 2007, 10:55 PM
#95
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

TheOracle:

Let's do a little test here. In your includes/modules/pages/<your_template>/account_edit.php file,

right below this line:

$account = $db->Execute($account_query);

> 
> (and asusming you included the $additional_sql variable into the SQL SELECT statement as instructed),
> 
> paste the following command:
> 
> ```php
echo $account->fields['customers_whole'];

(assuming that field still exists too).

Then, log in into your test account. Go to your account info page and tell me if you see something at the top of your page.

nope... nothing..

though now i do have "Additional Customers Fields" on the top of each page of my zencart pages....i wonder why

2 Jun 2007, 10:57 PM
#96
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

sadr1an1:

i did try to follow the steps that you mentioned.... thanks for that... but now i have the following error on all pages:

Fatal error: Call to a member function on a non-object in /home/content/g/e/o/georgidesign/html/store/includes/languages/english/extra_definitions/tpl_account_edit_default.php on line 18

cant access my website now

2 Jun 2007, 11:09 PM
#97
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

nope... nothing..

though now i do have "Additional Customers Fields" on the top of each page of my zencart pages....i wonder why

If you could provide an access to your FTP server and provide me the URL (both over email). I could check this out directly for you if you'd like. My email is in the installation text file from the package.

2 Jun 2007, 11:48 PM
#98
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

TheOracle:

If you could provide an access to your FTP server and provide me the URL (both over email). I could check this out directly for you if you'd like. My email is in the installation text file from the package.

info emailed.

Thanks again.

AP

3 Jun 2007, 12:02 AM
#99
theoracle avatar

theoracle

Suspended

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

Re: Additional Customers Fields

Ok ... now - it's pretty obvious why it doesn't work out well for you.

1 - You are not using template overrides. You have simply kept the name: template_default as a customized module name under your includes/modules folder.

2 - Your includes/templates contains the folder name: your_template ? :blink:

That is the problem actually. I think you need to read the wiki documentation, FAQs and search for posts perhaps even buying the Zen-Cart's book regarding the way to create overrides . . .

Otherwise, you will just hit a wall (like the emoticon here demonstrates so well).

The your_template name was identified as is from my package so that Zen-Cart users would simply need to go under that folder name and upload these two files under their actual existing overrides folder name from their FTP end.

Template overrides are a must on every cases.

3 Jun 2007, 12:47 AM
#100
ali_peracha avatar

ali_peracha

New Zenner

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

Re: Additional Customers Fields

TheOracle:

Ok ... now - it's pretty obvious why it doesn't work out well for you.

1 - You are not using template overrides. You have simply kept the name: template_default as a customized module name under your includes/modules folder.

2 - Your includes/templates contains the folder name: your_template ? :blink:

That is the problem actually. I think you need to read the wiki documentation, FAQs and search for posts perhaps even buying the Zen-Cart's book regarding the way to create overrides . . .

Otherwise, you will just hit a wall (like the emoticon here demonstrates so well).

The your_template name was identified as is from my package so that Zen-Cart users would simply need to go under that folder name and upload these two files under their actual existing overrides folder name from their FTP end.

Template overrides are a must on every cases.

Yea i know... my customized template name is GDS... it has all the MODs i have installed.... the your_template is there so i can put the original file there as a secondary backup of the files that im editing over the server.... besides this, i don't use the your_template folder for anything else.

right now my server is down completely for some reason.. i was following adr1an1's instructions... and now i get Fatal error: Call to a member function on a non-object in /home/content/g/e/o/georgidesign/html/store/includes/languages/english/extra_definitions/tpl_account_edit_default.php on line 18 on every page... the admin side is working fine for now.

I'll probably delete it all again, download a fresh MOD and start alllllll over again.....:unsure: