Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding new fields to the Customer Details

Adding new fields to the Customer Details

Locked

Views: 7,281

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
12 Jan 2007, 8:36 PM
#1
dustyshoes avatar

dustyshoes

New Zenner

Join Date:
Jan 2007
Posts:
12
Plugin Contributions:
0

Adding new fields to the Customer Details

I have a client that lost his Zen Cart developer mid-project. I am an experienced PHP developer, but new to the cart.

The requirement is to add four new fields to the Client Details, the page you fill out to get an id to the site. He wants to add a Fed Tax Id, Business Type, etc.

Going through the forum and faqs, I think my approach is to:
Add a new database table for the fields, this will prevent me from losing the fields when he upgrades.

Add the fields to a language file in the language override directory. This file already exists, it was left by the previous dev.

Add the fields to a template in the override dir. Like the language, this file is already there, it just needs the new fields.

Change the code that saves the data (header_php.php?). My understanding is that this is outside the override system. I believe I need to back up the original, make the changes, and backup the new. Lastly leave good notes about this so that I will remember to deal with it when we upgrade in the future.

If I am about to blow a big hole in my foot, please let me know.

Thanks!

13 Jan 2007, 12:17 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding new fields to the Customer Details

Boom ... :eek:

Unless there is a reason for a new table adding to an existing table is fine ... you just need to confirm that access to the table for adding, editing, etc. manages the existing fields as well as the new ones ...

Upgrades should not toss your tables ... just update your code and be sure to apply the changes when needed ...

So you need to determin which table owns the field ...
customers
customers_info
address_book

This is actually much easier than trying to join tables and track them together etc.

13 Jan 2007, 6:09 PM
#3
dustyshoes avatar

dustyshoes

New Zenner

Join Date:
Jan 2007
Posts:
12
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

Thanks for the feedback! The work is in and working, so I am not going to take your advice this time. That is great to know for the future though.

Tom

24 Jan 2007, 9:44 PM
#4
stephane avatar

stephane

New Zenner

Join Date:
Nov 2006
Posts:
4
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

Hi,

I am currently working on the same kind of development :wink2: (need to add a field in the create account page).

I have no problem with the database (customers table), the override template dir. (/includes/templates/my_template/templates/tpl_modules_create_account.php) and the override languages dir. (/includes/languages/my_template/english.php and as you maybe guessed ... french.php).

But like DustyShoes, I am less sure with the way to update the database :
I guessed i have to change the /includes/modules/create_account.php file and my questions are :

  • Am i correct ?
  • is there any other files I need to change ?
  • is there a way to use the override system to deal with the file create_account.php ?

Thanks a lot for your help

24 Jan 2007, 9:59 PM
#5
stephane avatar

stephane

New Zenner

Join Date:
Nov 2006
Posts:
4
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

my mistake :smile:

I absolutly can use the create_account.php file with the override system :

/includes/modules/my_template/create_account.php

This override system is really cool

Thanks a lot

29 Jun 2007, 5:07 AM
#6
theoracle avatar

theoracle

Suspended

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

Re: Adding new fields to the Customer Details

You can always download my contribution called: Additional Customers Fields available from my signature link. Since a couple of days, it has been recognized as a solid and flexible addon. :wink2:

11 Dec 2008, 5:15 PM
#7
lmm314 avatar

lmm314

New Zenner

Join Date:
Dec 2008
Posts:
2
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

Hello, Im new to Zen and my knowledge of php isn't that great. I know this thread is kind of old but I was wondering if anyone could explain in plain English (pretend your talking to someone who has no clue about codes and such) of how to add the options the original poster questioned. My client has asked for this...

need for business registration info (eg tax ID) that can be cross checked and validated before giving permission for the viewer to see our prices and trade arrangements.

I have most of the shopping cart going except for this. Im stumped. Can anyone help us?
Thank you.

13 Dec 2008, 11:52 PM
#8
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

lmm314:

Hello, Im new to Zen and my knowledge of php isn't that great. I know this thread is kind of old but I was wondering if anyone could explain in plain English (pretend your talking to someone who has no clue about codes and such) of how to add the options the original poster questioned. My client has asked for this...

need for business registration info (eg tax ID) that can be cross checked and validated before giving permission for the viewer to see our prices and trade arrangements.

I have most of the shopping cart going except for this. Im stumped. Can anyone help us?
Thank you.

Start with the new fields by downloading the mod mentioned above and see how they add the new felds.

14 Dec 2008, 5:29 PM
#9
lmm314 avatar

lmm314

New Zenner

Join Date:
Dec 2008
Posts:
2
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

what mod are you talking about? :unsure: Remember...Im new to Zen, Im just a HTML web designer, no eccommerce expertise here :wink: Are you talking about following Oracles signature? I did click on his/her profile and got a 5 or 6 page thread of some unhappy people.

30 Dec 2008, 5:21 PM
#11
johnfriend avatar

johnfriend

New Zenner

Join Date:
Dec 2008
Posts:
2
Plugin Contributions:
0

Re: Adding new fields to the Customer Details

I am looking for the same thing, but the latest update for the mod doesn't seem to have a valid link.

I also installed a previous version, and in my admin panel, it still lacks the option to add additional customer details under the customer tab. Any idea of what I could of done wrong?