Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2007
    Posts
    12
    Plugin Contributions
    0

    Default 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!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding new fields to the Customer Details

    Boom ...

    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.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2007
    Posts
    12
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Nov 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding new fields to the Customer Details

    Hi,

    I am currently working on the same kind of development (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

  5. #5
    Join Date
    Nov 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding new fields to the Customer Details

    my mistake


    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

  6. #6
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default 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.

  7. #7
    Join Date
    Dec 2008
    Posts
    2
    Plugin Contributions
    0

    red flag 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.

  8. #8
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Adding new fields to the Customer Details

    Quote Originally Posted by lmm314 View Post
    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.

  9. #9
    Join Date
    Dec 2008
    Posts
    2
    Plugin Contributions
    0

    Default Re: Adding new fields to the Customer Details

    what mod are you talking about? Remember...Im new to Zen, Im just a HTML web designer, no eccommerce expertise here 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.

  10. #10
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Adding new fields to the Customer Details

    Quote Originally Posted by lmm314 View Post
    what mod are you talking about?
    http://www.zen-cart.com/index.php?ma...roducts_id=587

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Adding fields to customer details-- 2 questions
    By jdl in forum Customization from the Admin
    Replies: 5
    Last Post: 30 Jul 2010, 08:35 PM
  2. Adding new customer fields - error checking
    By valtx in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Jan 2008, 06:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR