Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing order/format of Delivery Address


galen

Recommended Posts

Hi all,

 

I've been playing around with the required fields and i've added in some new fields like Title instead of gender and company abn etc as i live in australia.

 

but what i can't work out as of yet is where and what to change , to have the deliver address changed.

 

currently it is being displayed as the default but as i have removed some fields it looks "screwed" :D

 

so can anyone point me in the right direction/code to help resolve this discrepency.

 

Regards

Galen

Link to comment
Share on other sites

I ended up answering my question on another quest. The values are held in the database under the table address format, but from the looks of things you can change the address formatting under the admin panel under countrys, 1-5 each corresponding to a different format, alas if the ones they have dont' go with what you want edit the database manually using myphpadmin

 

 

Galen

Link to comment
Share on other sites

I am trying to change the order of the "Sold To" and "Ship To" address on the Invoice and PicKing Slip. Changing the "Address Format" on the countries admin page made no difference.

 

Does anyone know how to do this, I want it to read

 

Line 1 Name

Line 2 Number + Street Name

Line 3 Town or City

Line 4 County/Area

Line 5 Post Code and Country

 

At the moment line 4 is Town + Post Code and Line 5 is County + Country

 

Thanks

Phil

:(

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Link to comment
Share on other sites

From about line 168 down in the script: catalog/include/modules/account_details.php is where the account info is defined visually on the screen, edit the table to get this right.

 

Also in admin/invoice.php you can set out the way your invoice is created!

 

I think this is what you're looking for.

 

Hope it helps.

 

C

Link to comment
Share on other sites

Hi

 

Thanks Craig for your input, but as a novice I am struggling to find the code I need to change.

 

From about line 168 down in the script: catalog/include/modules/account_details.php is where the account info is defined visually on the screen

This seems to be the order it appears on the account entry screen.

 

Also in admin/invoice.php you can set out the way your invoice is created!  

There is nothing in here that allows me to alter the layout of the address

 

The coding relating to the address is this

</tr>

 <tr>

   <td><table width="100%" border="0" cellspacing="0" cellpadding="2">

     <tr>

       <td colspan="2"><?php echo tep_draw_separator(); ?></td>

     </tr>

     <tr>

       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

         <tr>

           <td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>

         </tr>

         <tr>

           <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, ' ', '<br>'); ?></td>

         </tr>

         <tr>

           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo $order->customer['telephone']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>

         </tr>

       </table></td>

       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

         <tr>

           <td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>

         </tr>

         <tr>

           <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>

         </tr>

       </table></td>

     </tr>

   </table></td>

 

So where do I change the tep_address_format ?

 

If anyone can help

 

Thanks

Phil

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Link to comment
Share on other sites

Hi

 

Thanks Martin, I have downloaded and read the documentation many times but I am afraid to say in this case it does NOT cover what I am trying to achieve, but I will stand corrected if you can point me to the page that holds the info I am after.

 

Thanks

Phil

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Link to comment
Share on other sites

No, I am try to change the following

 

I am trying to change the order of the "Sold To" and "Ship To" address on the Invoice and PicKing Slip. Changing the "Address Format" on the countries admin page made no difference.  

 

Does anyone know how to do this, I want it to read  

 

Line 1 Name  

Line 2 Number + Street Name  

Line 3 Town or City  

Line 4 County/Area  

Line 5 Post Code and Country  

 

At the moment line 4 is Town + Post Code and Line 5 is County + Country

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Link to comment
Share on other sites

HI,

 

I don't see the problem, in the code you posted above, just move the info between the <tr></tr> e.g.

 

<tr>

<td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>

</tr>

 

move them to the order that you want them to appear!

 

THat should do it!

 

C

Link to comment
Share on other sites

OK, I have had a good look, and as said before, if you create a new address_format in the DB table address_format and reference that from your country code in the admin/countries page, then that should work!

 

The Invoice and Packing slip both use that DB table to display the Address, so you need to test it! THOUROGHLY!

 

That should do it...

 

C

 

I'm off out now, but when I get back, I'm going to try it as it may sole some issues I have with different address formats, as I have made other mods that override this function. I didn't know it was an option in the DB, but NOW I DO! hehe

Link to comment
Share on other sites

Hi Craig

 

if you create a new address_format in the DB table address_format and reference that from your country code in the admin/countries page

 

This works purrrfectly, I think I have tested it enough.

 

The new address format I created in the DB was

$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country

 

Which means my address would display and print like this:-

Phil Townsend

Waterslap Farm

Airth

Falkirk

FK2 8QW

United Kingdom

 

A note for anyone reading this now or in the future, IT DOES NOT SEEM TO WANT TO CHANGE EXISTING ORDERS ONLY NEW ONES.

 

So make the change and then add a new order for the change to take effect.

 

Thanks for your help

Phil

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Link to comment
Share on other sites

Yep, tried it too, and got the same result, except if you look into the table ORDERS there is a record called customers_address_format_id if you change that to the ID of you new address format for all orders, then it will display the info correctly in the invoice!!

 

Thanks fo the help, and hope I helped too.

 

Cheers,

 

C

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...