Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Birthday with combo selection


caccamo81

Recommended Posts

http://addons.oscommerce.com/info/6287

 

English (I hope!) Support here

 

 

The Birthdate combo select contribution provides the following enhancements to the Create Account and Edit Account features of osCommerce:

-Date of birth's field is now divided into three combo select, ones for day, month and year

 

With this plugin, users simply have to choise a date from a combo select (drop down) without thinking the date format (xx/xx/xxxx).

Administrator has not this functionality.

 

 

Italian language is also disponible by requesting mail.

Edited by caccamo81
Link to comment
Share on other sites

http://addons.oscommerce.com/info/6287

 

English (I hope!) Support here

 

 

The Birthdate combo select contribution provides the following enhancements to the Create Account and Edit Account features of osCommerce:

-Date of birth's field is now divided into three combo select, ones for day, month and year

 

With this plugin, users simply have to choise a date from a combo select (drop down) without thinking the date format (xx/xx/xxxx).

Administrator has not this functionality.

 

 

Italian language is also disponible by requesting mail.

 

Hi

 

Nice contrib...will make things easier for the user, thanks.

 

Where do I change the date format so that I have ddMMYYYY. OsCommerce uses MMddYYYY by default.

Link to comment
Share on other sites

I had not thinking in this problem, italy use ddMMYYYY as date format.

 

First, you must modify the order of the http_post_vars:

 

this code

if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['day_dob']."/".$HTTP_POST_VARS['month_dob']."/".$HTTP_POST_VARS['year_dob']);

 

can be change in

if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['month_dob']."/".$HTTP_POST_VARS['day_dob']."/".$HTTP_POST_VARS['year_dob']);

----------

 

Second, you have to change the order of the comboboxes.

 

---------

 

finally you have to change this:

in the day block:

if($i==(int)substr(tep_date_short($account['customers_dob']),0,2))

replace with

if($i==(int)substr(tep_date_short($account['customers_dob']),3,2))

 

 

in the month block:

if($i==(int)substr(tep_date_short($account['customers_dob']),3,2))

replace with

if($i==(int)substr(tep_date_short($account['customers_dob']),0,2))

 

 

 

I have not test this modification, but I think it probably works

Edited by caccamo81
Link to comment
Share on other sites

Hi

 

Thanks for your reply...

I actually meant Where do you change the date format in OsCommerce because we also use the date format ddMMYYYY here in South Africa. Nothing wrong with your code. But I found where to do that. In catalog\includes\languages\english.php just edit to this

 

 

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 date()

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);

}

}

Link to comment
Share on other sites

  • 3 months later...
Hi

 

Thanks for your reply...

I actually meant Where do you change the date format in OsCommerce because we also use the date format ddMMYYYY here in South Africa. Nothing wrong with your code. But I found where to do that. In catalog\includes\languages\english.php just edit to this

 

 

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 date()

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);

}

}

 

 

I think these changes will also need to be done in catalog\admin\includes\languages\english.php if you want dd/mm/yyyy in admin.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I had the same problem, not sure why because the age is selected in english.php, but anyway I just hard-coded it. Is also easier when you have many different languages

 

Look for the following code in both files

$startYear=$today['year']-MAX_SELL_AGE;
$endYear=$today['year']-MIN_SELL_AGE;

 

and just fill in the years, for example like

$startYear=$today['year']-100;
$endYear=$today['year']-1;

Edited by tfbpa
Link to comment
Share on other sites

  • 4 months later...

My dates are messed up.

 

date of birth entry pull down has the 3 seperate pull downs for month, day, year. The Month pull down goes to 31 and the day pull down goes to 12. The year is correct.

 

How do I change them around?

Link to comment
Share on other sites

  • 1 year later...

Hello, sorry for my english. I install de contribution more weeks ago and all is allright, but today one client send me a email because he can't create a account because he have a problem with the date of birth. Always the problem say: "select your date of birth". I try a create account but i have the same problem, and i try with differents days, months and years but always appear the error.

I unistall the contribution and install one more time, but the problem is here. What happen?

Thanks!

Link to comment
Share on other sites

  • 1 year later...

Hello, Can anyone help with this? I have been looking to see if it has been resolved, but none of the standard help locations mention it. This is a great contribution, but I simply do not know how to fix this one issue. It come up when a customer is trying to edit their account information. The birthday shows up partially filled out and partially at default values. This confuses the customer and forces them to call or try to change the information over and over. I have attached a .jpg file and my account_edit.php for reference. If you need anything else please let me know! My understanding of the code is very basic. I can modify most files and use comparison programs.

 

Thank You All for your help!

 

account_edit.php

 

post-221996-0-75854000-1362442524_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...