Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove comma in address


Tonyboy1

Recommended Posts

Hi all,

 

I have a question about the address format. Currently, the custmer address fields are looking like this (to my customers when logged in and on the delivery note)

 

NAME

ADDRESS 1

ADDRESS 2

TOWN, POSTCODE

COUNTRY

 

How can I remove the comma, and add a page break, so that each address field is on a separate line?

 

Thanks!

Tony

Link to comment
Share on other sites

Are you using the correct address format for your country? That format looks like the 'default' (number 1 in the address_format table). USA addresses are number 2, and are

 

NAME

ADDRESS1

ADDRESS2

CITY, STATE POSTCODE

COUNTRY

 

I think there's some place in Admin to change/add address formats. For example, if you're US-based and you're mailing to a US customer, you would drop the COUNTRY part.

Link to comment
Share on other sites

This thread shows how to move the postacode, so i'm guessing if you go into those files you can add a break in there too. Haven't gone into yet, so i could be wrong, but its worth a look!

 

http://www.oscommerce.com/forums/index.php?showtopic=320688

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

Thank you for all your answers so far!

 

The input fields for the address are in perfect order. My issue is with the way the address appears in the address book to my customers, and on the delivery note.

 

I've researched further, and it seems to me as though regardless of whether you have enabled the 'STATE' field, the address will always display a maximum of four lines, so it will always appear in the address book as follows:

 

ADDRESS 1

ADDRESS 2

CITY, POSTCODE

STATE, COUNTRY

 

or, with STATE off,

 

ADDRESS 1

ADDRESS 2

CITY, POSTCODE

COUNTRY

 

I have checked all the PHP files and can't seem to find the page relating to the appearance of the address, so I hope the above offers a clue.

 

Any other ideas would be very much appreciated.

 

Thanks!

Tony

Link to comment
Share on other sites

Every country (countries table) has a default entry for format to use (address_format_id), and the orders table has several references to it. The 'default' is number 1, which is the layout you described. You probably want number 2 (USA). I'm not able to get to my installation right now, but there should be something in the admin governing what address format to use for a given country, and how that format is laid out. If not, you could edit the address_format table in phpMyAdmin (or the like) to arrange the address differently. The US layout (number 2) is '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country'. Season to taste by adding $cr and removing "," and/or $country.

Link to comment
Share on other sites

Fixed it - thank you MrPhil!

 

It was in the MySQL database, under address_format. Here's what I did:

 

Not being a programmer, I thought it'd be safer to create a new address_format ID, and copy the info from ID 1.

I simply changed the format from

 

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

 

to

 

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

 

I then updated the countries table on the contol panel to the new ID, which in this case was 6, and it worked a treat!

 

Just out of curiosity, what is the address_summary in the MySQL database used for?

 

Thanks again, and to all those who responded as well.

Link to comment
Share on other sites

Not sure what 'address_summary' is used for. I don't see it in the code.

 

Anyway, glad to hear that you're working now. Note that if you ever get a customer from outside the US, their address may not format correctly (undeliverable goods?), so be careful.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...