Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Sign in to follow this  

How do I edit DOB format in admin?

Recommended Posts

How do I edit the required format for the DOB entry in the admin area?


I have a wholesale website and I've been using the add-ons where you must be logged in to view prices, and the restricted_website so that new customers need an authorization word to create an account. (This one here: http://addons.oscommerce.com/info/4399) It's been working great, except one thing... if I want to edit an account in my admin area, it won't let me. When I try to edit an account, it is saying there is an error because the DOB entry must be in the form xx/xx/xxx. The restricted website add-on is using the DOB entry to collect the authorization word, but the format didn't get changed in the admin side. Although, I thought I had made all the same changes in the admin as I did in the front end. Any help?? I know this is an easy fix, but I'm not proficient in php, and I'm not too familiar with all of the different pages in oscommerce..

Share this post

Link to post
Share on other sites

Didint get what you are actually asking , If you want to change D/M/Y to M/D/Y go to catalog/includes/languages/emglish.php



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


Edited by diy

Share this post

Link to post
Share on other sites

Sorry to be confusing; but that's not exactly what I need to do. The contrib I installed is using the dob field and changed it so the customers need to put in a preset word (authorization word) in that field. So, it is not in any date format; its a word. It works fine on the customer end when they use it to create an account, then when I view their account, the field is blank, and its asking for a date when I try to edit anything else on the account.


I either need to make that field non-mandatory in the back end (while leaving it mandatory on the front end), OR change the admin so that the dob field can be filled in with my authorization word instead of a date.




Here is PART of the changes I did on the front end to make it work (I posted a link to the contrib above):




In create_account.php, find around line 81:


if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); DELETE IT



if (ACCOUNT_DOB == 'true') {

if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {

$error = true;


REPLACE WITH (insert your own authorization word):


if (ACCOUNT_DOB == 'true') {

if (isset($HTTP_POST_VARS ['dob'])){

$dob = tep_db_prepare_input ($HTTP_POST_VARS['dob']);

} else {

$dob = false;




if (ACCOUNT_DOB == 'true') {

if ( ($dob != 'PutYourAuthorizationWordHere') ) {

$error = true;

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this