Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Swedish settings


Robban Karlsson

Recommended Posts

Hi all!

 

Please help me with getting theese things sorted out:

1. How to get the date of birth-field in add acount to work

 

I have tried to fix with the swedish.php-files in catalog and admin section in order to get it to accept swedish date of birth-format.

I want the field in add account to accept me to write: 700529 (YYMMDD)

This is what I've got:

 

setlocale(LC_TIME, 'swedish');

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

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

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

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

 

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

if ($reverse) {

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

} else {

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

}

}

 

This applies to both admin and catalog files, I also get an error:

Warning: checkdate() expects parameter 2 to be long, string given in C:\Apache2\htdocs\oscommerce\catalog\account_edit.php on line 55

 

when I try to change the date. It does accept 1970-05-29 i think.

 

According to my thoughts it has to do with the tep_date_raw substr values but I don't know in which order to set em up!

 

2. How to add additional information in same text box

In sweden we don't just use date of birth, we use "personal number" which is the date of birth "70-05-29" AND a numerical code "1234". Like this: 700529-1234

 

Do I need to turn datechecking of for this textbox (where?) or can I someway tell the program to get this in the table anyway?

 

Best would be to turn it of so I can use it for companies that have a 10 digit code with no dates in it what so ever.

 

Help appriciated.

 

Best Regards

Robban

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...