Zen Cart Logo
Forums / General Questions / Adding fields to shipto address

Adding fields to shipto address

Views: 967

Results 1 to 9 of 9
21 Apr 2011, 2:14 PM
#1
brandon avatar

brandon

New Zenner

Join Date:
Mar 2005
Posts:
64
Plugin Contributions:
0

Adding fields to shipto address

Zen 1.3.9h

I am adding new fields to the shipto address (telephone, best time to call and email). These are necessary because of some special customers that order for other customers. I will be happy to explain the necessity further if necessary.

Almost everything is working - the fields are stored in the addressbook.

But they are not being stored in the order.

I have modified orders.php to include them in $this->delivery(around line 150) $sql_data_array (around line 590).

I know that this is having a good effect because now the fields are blank instead of NULL in the database.

I am missing something that I am having trouble finding that processes the value from the form and makes it available to orders.php!

21 Apr 2011, 2:53 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding fields to shipto address

I don't know if this helps but read please... It is close..> http://www.zen-cart.com/forum/showthread.php?t=73414

21 Apr 2011, 3:23 PM
#3
brandon avatar

brandon

New Zenner

Join Date:
Mar 2005
Posts:
64
Plugin Contributions:
0

Re: Adding fields to shipto address

haredo:

I don't know if this helps but read please... It is close..

Thanks - it is close. Very close.

And I have trying to do the tracing of other fields.

I have not yet found the golden key :) I am hoping for somebody who has been there before.

One thing that I believe is significant is that my new fields occur in the delivery array. OTOH that might not matter. As you know, zen code has many potential distractions :)

22 Apr 2011, 12:34 AM
#5
brandon avatar

brandon

New Zenner

Join Date:
Mar 2005
Posts:
64
Plugin Contributions:
0

Re: Adding fields to shipto address

I am all set - my problem was in making the linkages from form to field to sql. I had all the right places to alter but my naming was a little sloppy.

Thanks all :)

22 Apr 2011, 12:35 AM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding fields to shipto address

Sweet!... Would be nice if you would post the fix for me and fellow zenners with this problem to find the right solution... :smile:

22 Apr 2011, 12:57 AM
#7
brandon avatar

brandon

New Zenner

Join Date:
Mar 2005
Posts:
64
Plugin Contributions:
0

Re: Adding fields to shipto address

I am not trying to keep it a secret.

The problem is that it is spread over several files and depends on where you want to put the field - ship/to address, additional order header fields, separate table.

I uploaded my includes/classes/order.php (called order.zip) - if you diff it to the stock one you will see all my changes. I do not warrant it useful for others and it might still be buggy :)

As to actually putting the data on the form involved - as I said, it depends on where - in my case, modules/checkout_new_address and the relevant template. In the correct override directories for my template.

22 Apr 2011, 12:59 AM
#8
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding fields to shipto address

Ty Brandon .... :smile:

22 Apr 2011, 10:48 AM
#9
brandon avatar

brandon

New Zenner

Join Date:
Mar 2005
Posts:
64
Plugin Contributions:
0

Re: Adding fields to shipto address

BTW I did comment my changes so just reading it would work but a graphical diff is miles better, especially for awesome marvel that is zencart source code.