Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Address Form Format


beeonline

Recommended Posts

Hi

I am trying to change the position of the post code on all the address forms from...

 

Gender:  Male    Female *

First Name:  *

Last Name:  *

Date of Birth:  * (eg. 05/21/1970)

E-Mail Address:  *

 

 

 

Company Details

Company Name: 

 

 

 

Your Address

Street Address:  *

Suburb:

Post Code:  *    from here

City:  *

State/Province:  * 

Post Code:  * to this position

Country:

 

I have searched all over the forum for the past 4 hours to no avail...:wacko:

 

Can any one help on this one .... Please

 

 

Cheers Malc :wacko:

Link to comment
Share on other sites

I presume you are referring to the address form when creating an account.

 

first backup the file catalog/create_account.php. Next open this file with a text editor.

 

Around lines 403 - 406, search for:

 

<tr>

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

<td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>

</tr>

 

cut this piece of code, and proceed to lines 436 - 439. Search for:

 

<tr>

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

<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

</tr>

 

Paste your code before this. That's it!

 

Hope this helps...

Link to comment
Share on other sites

Hi

Thanks for your reply....

 

This was the 1st thing I tried, unfortunately this only changes the form on that page. I have also changed the form on other pages in the catalog and admin too...

 

But when I check the invoice or the packing slip the address still shows in the old format...

 

This is driving me nuts...is there a easier way that I am missing???????????...

 

Help please Malc :blink:

Link to comment
Share on other sites

You are right to say that this only affects the form on that page.

 

For invoice and packing slip, it is dependent on the address format set for your country. You can change the address format through osCommerce Admin. Just look under Locations/Taxes then Countries, and pick your country. You should be able to see an Address Format: (Certain Number) associated with your country.

 

If you want to know what the number means, you will have to goto phpMyAdmin and look under address_format table. I'll list the format here just for your reference:

 

1. $firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country

2. $firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country

3. $firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country

4. $firstname $lastname$cr$streets$cr$city ($postcode)$cr$country

5. $firstname $lastname$cr$streets$cr$postcode $city$cr$country

6. $firstname $lastname$cr$streets$cr$country $postcode

 

If I am not wrong, format 2 should be what you are looking for.

 

Let me know if this helps.

Link to comment
Share on other sites

Hi Patrick

 

Thanks.... this did the trick. Darn that was mind bender :wacko:

 

Now on to the next prob... my client wants extra pages added and now I have to figure that one out...

 

The problem is the Invision search is terrible... so if you have angle on creating pages it would be muchly appreciated...

 

Thanks once again Malc

Link to comment
Share on other sites

  • 3 months later...

I had the same problem with changing the order. I've figured out which files need to be changed:

 

catalog/languages/english.php

(I changed 'Post Code' to 'ZIP Code')

 

These are the files that need to be changed where you move the table row for the ZIP Code to go above the Country field:

catalog/create_account.php

catalog/includes/modules/checkout_new_address.php

catalog/includes/modules/address_book_details.php

 

And if you have the osc_affiliates module, you can edit:

catalog/includes/modules/affiliate_signup_details.php

Link to comment
Share on other sites

  • 1 month later...

Umm I'm still having a little problem with this?

 

Patrick (Moonstone) posted 6 options for the address type, but when I look at my drop down I only show 5 options? Option 6 is the one I want to put in. I'm running the latest version. Any ideas why I got short changed? ;)

Link to comment
Share on other sites

Hi Vic,

 

I have no idea why you got short changed. :P

 

However, you can easily add a new address format using phpMyAdmin.

 

Simply create a new entry with the following values in the address_format table, and option 6 should be available to you:

 

address_format_id: 6

address_format: $firstname $lastname$cr$streets$cr$country $postcode

address_summary: $country $postcode

 

Hope this helps. ;)

Link to comment
Share on other sites

Thanks for the assist!

 

I added the new entry, no problem, but when I check the orders nothing seems to have changed? Will this only work on NEW orders or will it be retroactive?

 

Again thanks for your time and patience.

Link to comment
Share on other sites

PS: I should mention that I did go into the countries and change the address format to the new value "6", then looked at previous orders via the packing slip to see if the address changed.

Link to comment
Share on other sites

Hi Vic,

 

Unfortunately, this change will only be reflected on new orders. :(

 

However do not despair, as you can easily change the address format for previous orders simply by issuing an SQL statement. Before we do anything, remember to first backup your data.

 

Next, let us understand why the change did not affect previous orders. If you look into table orders, you will notice three fields by the names of customers_address_format_id, delivery_address_format_id and billing_address_format_id. Let's say your previous address format was set to 1. In this case, you will see 1s for all three fields. Similarly, for new orders, you will see 6s for all three fields. These actually determine how the addresses are being displayed for each of the order/invoice.

 

Now, let's go on to changing the address format for previous orders. Assuming you want to change the address format for ALL previous orders to 6, simply issue the following SQL statement:

 

UPDATE `orders` SET `customers_address_format_id` = '6',

`delivery_address_format_id` = '6',

`billing_address_format_id` = '6';

 

That's it!

 

Hope that helps. :lol:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...