Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Address Layout???


Offenham

Recommended Posts

Hi

 

I changed the format of the address layout (UK style) when a user creates an account. However when you go to checkout and "Delivery Information" the "Shipping Address" reverts back to the original format so the State is displayed after the post code.

 

Any idea how I change this to reflect the way I set it up in create account?

 

Thanks

 

David :cry:

Link to comment
Share on other sites

Hi Ken

 

Yep I did that already and the account create looks and works fine - its the way its displayed in the Checkout/Billing Address that's wrong - It reverts back to the defualt setup for some reason so I guess it neds changing somewhere else too.

Link to comment
Share on other sites

If you use English as default language you should have the address format with state followed by post code. The format is set in the database under table address_format. I think English uses format 2.

 

Ken

Link to comment
Share on other sites

  • 4 weeks later...

Hi

 

I'm looking into this myself, did you just use the existing fields in the database and change the cosmetics on the account_details.php page?

 

Where do the zones fit in?

 

Otherwise, this is what I have in mind...

 

entry_street_address --> address line 1

entry_suburb --> address line 2

entry_city --> city / town

entry_state --> county

entry_postcode --> postcode

entry_country_id --> country

 

Then add a new address_format record along the lines of what I want it to look like and set that in the countries table.

 

Is that what you did?

 

Thanks

K

K

.....................................................................

When the going get's tough,

the tough get going.

Link to comment
Share on other sites

entry_street_address --> address line 1  

entry_suburb --> address line 2  

entry_city --> city / town  

entry_state --> county  

entry_postcode --> postcode  

entry_country_id --> country

 

This is exactly what I need too. Anyone able to help out a newbie? :)

Link to comment
Share on other sites

Here's a summary on how to change the address layout and text so that's it's more uk-centric:

 

 

A. change row order:

 

to change order of fields displayed in the following files (NO NEED TO CHANGE THESE FILES - read on)

1. /catalog/create_account.php AND

2. /catalog/account_edit.php AND

3. /catalog/checkout_shipping_address.php

4. /catalog/checkout_payment_address.php

 

Rearrange any of the fields the way you want them to be by simply moving the table cell that holds the listing. It is simple a matter of copying the <tr><td></td></tr> tags of one name to a different location.

see http://wiki.oscommerce.com/helpModsEditAccount

 

These are the files you need to edit -

1. /catalog/includes/modules/account_details.php AND

2. /catalog/includes/modules/checkout_new_address

 

B. Change text headings:

To change the Text for the account fields change the definitions (it's self explanatory when you read it through) in the following file

 

/catalog/includes/languages/english.php

 

 

entry_street_address --> address line 1

entry_suburb --> address line 2

entry_city --> city / town

entry_state --> county

entry_postcode --> postcode

entry_country_id --> country

 

Note this is also where you would change the date and ISO settings (see E below).

 

 

C. If using zones for counties:

 

To display the zone_name as opposed to the zone_code

in catalogincludesfunctionsgeneral.php change -

 

around Line 394: zone_code to zone_name

function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {

 ?

 //ka (want to see zone name when ordering) $state = tep_get_zone_code($country_id, $zone_id, $state);

 $state = tep_get_zone_name($country_id, $zone_id, $state);

 

around Line 457: zone_code to zone_name

function tep_address_summary($customers_id, $address_id) {

?

   //ka (want to see zone name when ordering) $state = tep_get_zone_code($address['entry_country_id'], $address['entry_zone_id'], $address['entry_state']);

 $state = tep_get_zone_name($address['entry_country_id'], $address['entry_zone_id'], $address['entry_state']);

 

D. Other topivs covering address Layout on order:

http://www.oscommerce.com/forums/viewtopic.php?p=145043#145043

http://www.oscommerce.com/forums/viewtopic.php?t=36972

 

E. UK Date formatting:

 

You may also be interested in the following, can't remember which topic I found this on. So in summary

 

Change some bits in english.php to look like this:

 

setlocale(LC_TIME, 'en_GB.ISO_8859-1'); 

define('DATE_FORMAT_SHORT', '%d %m %Y'); // this is used for strftime() 

define('DATE_FORMAT_LONG', '%A, %d %B %Y'); // this is used for strftime() 

define('DATE_FORMAT', 'd/m/Y'); // this is used for strftime() 

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); 



//// 

// Return date in raw format 

// $date should be in format mm/dd/yyyy 

// raw date is in format YYYYMMDD, or DDMMYYYY 

function tep_date_raw($date, $reverse = false) { 

if ($reverse) { 

return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4); 

} else { 

return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2); 

} 

} 



// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language) 

define('LANGUAGE_CURRENCY', 'GBP'); 



// Global entries for the <html> tag 

define('HTML_PARAMS','dir="LTR" lang="en"'); 



// charset for web pages and emails 

define('CHARSET', 'iso-8859-1');

 

and

 

define('JS_DOB', '* The 'Date of Birth' entry must be in the format: xx/xx/xxxx (day/month/year).n'); 

// text for date of birth example 

define('DOB_FORMAT_STRING', 'dd/mm/yyyy'); 





define('ENTRY_DATE_OF_BIRTH_ERROR', ' <small><font color="#FF0000">(eg. 21/05/1970)</font></small>'); 



define('ENTRY_DATE_OF_BIRTH_TEXT', ' <small>(eg. 21/05/1970) <font color="#AABBDD">required</font></small>');

 

Rather long, but at least I think it's in one place.

 

K

K

.....................................................................

When the going get's tough,

the tough get going.

Link to comment
Share on other sites

Depends on which side of the ocean you are on for the Proper English idea ... :wink:

 

People here look twice when written backwards ... er ... your way.

Link to comment
Share on other sites

Depends on which side of the ocean you are on for the Proper English idea ... :wink:  

 

People here look twice when written backwards ... er ... your way.

 

And you Merrikans drive on the wrong side of the road. And you Europeans too... ;) :D :lol:

Link to comment
Share on other sites

Depends on which side of the ocean you are on for the Proper English idea ... :wink:  

 

People here look twice when written backwards ... er ... your way.

 

And you Merrikans drive on the wrong side of the road. And you Europeans too... ;) :D :lol:

 

That's only because you guys stuck the steering wheel on the wrong side of the car ... :wink:

Link to comment
Share on other sites

How do you feel about creating two languages (= two flags, English and American)? Seems like overkill to me.

 

Some people would think that a good idea, just look how these crazy types are prattling on about it... No offense intended of course. I alos now see how you get your number of posts up.

 

Seriously, it would make sense from a currency point of view and seems it would really just require two english.php files.

 

K

K

.....................................................................

When the going get's tough,

the tough get going.

Link to comment
Share on other sites

How do you feel about creating two languages (= two flags, English and American)? Seems like overkill to me.

 

This is exactly what I did.

 

english_us and english_uk

 

Also, has anyone noticed the irony in osCommerce. The default language in the download is US English yet the flag to represent it is the Union Jack :lol: :P

Link to comment
Share on other sites

  • 4 weeks later...

Rename the file english.php to english_us.php.

 

Rename the folder "english" to "english_us".

 

Now create a copy of that file and that folder and replace us with uk.

 

Now edit english_uk.php to use GBP instead of USD and edit all of the date formats to UK style dates instead of US style ones.. There are a couple of other changes listed in this topic also. Mainly just spelling corrections cos we all know that americans can't spell ;)

 

Then set english_uk as the default language and set your configuration to automatically select currency based on language.

 

Hope this helps... i'm useless at giving instructions :roll:

Link to comment
Share on other sites

  • 1 year later...

B. Change text headings:

To change the Text for the account fields change the definitions (it's self explanatory when you read it through) in the following file

 

/catalog/includes/languages/english.php

 

 

entry_street_address --> address line 1

entry_suburb --> address line 2

entry_city --> city / town

entry_state --> county

entry_postcode --> postcode

entry_country_id --> country

 

 

I followed the step above and have come out with a problem, the fields for address line 2 and county are missing from the site. I must admit though that I replaced suburb in every file I could find with address line 2 and did the same with state.

Any ideas about this sudden vanishing trick?

 

edit: plus i would like to make the state/county field a straight text box instead of a pull down list.

Link to comment
Share on other sites

have you made sure that you have set suburb and state to true in your admin?

Also only change it in the english.php, if you change it anywhere else you can mess up the code. I did that before and had to restore.

 

Giovanna

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...