Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date format change, address notation to english terms, UK top of drop down menu?


Becki

Recommended Posts

Posted

Hi,

 

I've searched the forum and the contributions section but found nothing although I'm sure this has been talked about.

 

1) How can I change the date format so that it is dd/mm/yyyy instead of mm/dd/yyyy

 

2) How can i change state/suberb etc to english terms such as town and county etc.

 

3) How can I put UK to the top of the country drop down menu?

 

Many Thanks

 

Becki

Posted
Hi,

 

I've searched the forum and the contributions section but found nothing although I'm sure this has been talked about.

 

1) How can I change the date format so that it is dd/mm/yyyy instead of mm/dd/yyyy

 

2) How can i change state/suberb etc to english terms such as town and county etc.

 

3) How can I put UK to the top of the country drop down menu?

 

Many Thanks

 

Becki

 

 

this is how ive done these but im by no means an expert.

 

1.

function format_the_date($date){

return substr($date, 8, 2) . "-" . substr($date, 5, 2) . "-" . substr($date, 0, 4);

}

 

ive add this function to pages where i want the date formated dd-mm-yyyy

 

where you wnat the date dispalyed in this format change now() to format_the_date(now())

im sure there are better ways.

 

2.

find

define('ENTRY_SUBURB', 'Suburb:');

define('ENTRY_CITY', 'City:');

 

in includes/languages/english.php change to

define('ENTRY_SUBURB', 'Town:');

define('ENTRY_CITY', 'County:');

 

thats how ive done it.

 

 

3.

Putting uk to the top of the drop down menu dont think it would be an easy task..

but you could set it to the default selection:

 

2 things where the function calls tep_get_country_list('country') in your pages

change to tep_get_country_list('country', '222') 222 should be the default id for uk in your database

 

in includes/functions/html_output.php find

// Creates a pull-down list of countries

function tep_get_country_list($name, $selected = '', $parameters = '') {

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$countries = tep_get_countries();

 

comment out the second line thus

// Creates a pull-down list of countries

function tep_get_country_list($name, $selected = '', $parameters = '') {

//$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$countries = tep_get_countries();

 

this will stop the drop down having a select one option.

 

my store is only for uk business so ive removed all other countrys.

if you deal with other countrys doing this above may cause a problem for you since if someone from another country forgets to select their country it will be set to uk without warning.

 

hope some of this helps....

Posted

Thankyou very much for your reply, I shall certaintly give it all a try tomorrow and let you know how it goes :)

 

Sounds as though they are the answers to my problems!

 

Thanks

 

Becki

Posted

Hi, just played around with it and the country mod works great, just what i was after. Just one qu's - when i comment out that line is this just to remove ' Please select' from the top of the list?

 

Changed city and suberb etc - works again. I set in admin not to ask for state/province - is that what you did? Also stoppped it asking for the DOB and gender. Can't really see why this is needed except for market research? Is there a way to simply add a extra address field as i only have 1st line adress, town, postcode and county. I would like to put an extra field in before town?

 

So haven't implemented the DOB change, did your suggested changes mean that the customer entered it into a dd/mm/yyyy format rather than mm/dd/yyyy or was it simply converting it after they had entered in a mm/dd/yyyy format? I might still try it if it was to change the way they entered it.

 

Many thanks for your help, your time is very much appreciated. I could never have done the country change, it's great.

 

Thankyou

 

Becki

Posted
Hi, just played around with it and the country mod works great, just what i was after. Just one qu's - when i comment out that line is this just to remove ' Please select' from the top of the list?

 

Changed city and suberb etc - works again. I set in admin not to ask for state/province - is that what you did? Also stoppped it asking for the DOB and gender. Can't really see why this is needed except for market research? Is there a way to simply add a extra address field as i only have 1st line adress, town, postcode and county. I would like to put an extra field in before town?

 

So haven't implemented the DOB change, did your suggested changes mean that the customer entered it into a dd/mm/yyyy format rather than mm/dd/yyyy or was it simply converting it after they had entered in a mm/dd/yyyy format? I might still try it if it was to change the way they entered it.

 

Many thanks for your help, your time is very much appreciated. I could never have done the country change, it's great.

 

Thankyou

 

Becki

in answer to your first question yes it just removes the please select from the list.

 

answer to 2nd question yes i did set it not to ask for state in admin.. also dob and gender.

is there a way to add another address field. hmm.

i wouldnt say it was easy.

not sure what extra benefit it would give you. maybee take a look in the contribs might be something that ll suit you. other wise id steerclear of trying to add another field unless your comfortable with php , or it could cause you major headaches.

i was quite happy to have just one street address field.

 

last question....

what the function i posted was doing was changing the format of the date before DISPLAYING it.

dont use it to alter the date before is put into the DATABASE or it will cause you probs.

 

glad to be of help becki.

if you wanna get deeper into oscommerce a great book to start you out is

BUILDING ONLINE STORES WITH OSCOMMERCE : PROFESSIONAL EDITION

PACKT PUBLISHING: AUTHOR: DAVID MERCER.

 

about ?28 but well worth it .....

Archived

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

×
×
  • Create New...