Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to make "Date of Birth" not Required informati


Hossam

Recommended Posts

  • 3 weeks later...
Admin > Configuration > Customer Details

 

-jared

 

 

I have the same question, plus...

 

I want the customer to have the option of having thier birthday entered, but not required. I have played with the create_account.php page and the form_check.php, and might be getting close, but I wonder if their is a smarter way to do this.

 

Also, I want to have the birthday format example still displayed, but not in red, without the astrix.

 

Any help would be great.

 

Thanks

Link to comment
Share on other sites

Here's what I finally did - - it's been a while, so bear with me if it's not complete at first.

 

here's my code from create_account.php:

    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;

//        $messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
//      }
   }

 

then, in the same file, find this:

<?php
 if (ACCOUNT_DOB == 'true') {
?>
             <tr>
               <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
               <td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
 }
?>

 

and change the CSS class for the ENTRY_DATE_OF_BIRTH_TEXT from inputRequirement to use something else, or nothing, like this:

<?php
 if (ACCOUNT_DOB == 'true') {
?>
             <tr>
               <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
               <td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? ' ' . ENTRY_DATE_OF_BIRTH_TEXT . ' ': ''); ?></td>
             </tr>
<?php
 }
?>

 

From the includes/language/english.php, remove the asterisk from this line:

define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');

 

I also made this change in form_check.js.php:

<?php /* if (ACCOUNT_DOB == 'true') echo '  check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; */?>

.

 

Give that a shot.

 

-jared

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...