mikeuk Posted February 19, 2004 Posted February 19, 2004 Does anyone know how to make the Date of Birth field, a non-requirement?? Thanks.
AlanR Posted February 19, 2004 Posted February 19, 2004 It's an option in the amin module: configuration -> my store -> customer details Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
mikeuk Posted February 19, 2004 Author Posted February 19, 2004 brill. just what i needed but what about still having the option to let customers enter in their DOB but not as compulsary?? I see that by going to the admin module and setting the DOB to false, it physically removes the DOB text box altogether.
Guest Posted February 21, 2004 Posted February 21, 2004 Call me crazy but...I can't find this Customer Info option on my Admn panel?
kenchew Posted February 22, 2004 Posted February 22, 2004 Yes I'm having the same problem. How to set the gender and DOB field optional? The admin just toggles them on and off.
aldaffodil Posted February 22, 2004 Posted February 22, 2004 In catalog>create_account.php try commenting out the following code: 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 you will want to change 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 } ?> to 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')?></td> </tr> <?php } ?> Hope this helps!
kenchew Posted February 23, 2004 Posted February 23, 2004 Thanks! Found that also need to change include/form_check.js.php <?php if (ACCOUNT_DOB == 'true') echo ' check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; ?>
kenchew Posted February 23, 2004 Posted February 23, 2004 This hack is getting more complicated than I thought. Commenting out as suggested turns off the checking totally. I would like to have input checking if something is entered, if it is blank, just leave it optional. :unsure: any ideas?
gazzzzzza Posted February 24, 2004 Posted February 24, 2004 you could put an if statement round the error checking statement i think not 100% on exactly how oscommerce works with regard to checking (the javascript is something i havent messed with) but the basic premise of my solution should still work even if you have to tweak it a bit eg (in english) ----- if (dob_variable_not_empty) { run error check } ----- (in php) ----- if ($dob != "") { echo ' check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; } ----- please note you will need to replace $dob with whatever variable oscommerce uses to store the data that gets passed when the form field dob is sent - it will be buried within the code somewhere :( if anyone knows this variable then please post it here always here to offer some useless advice....
Guest Posted August 25, 2004 Posted August 25, 2004 Has anyone found the solution to this issue? I've searched and searched.. I need the field, but need it to be optional not required for the customer.
Qihun Posted August 25, 2004 Posted August 25, 2004 Go to INCLUDES/LANGUAGES/ENGLISH.PHP and remove from these fields mark to be required define('ENTRY_GENDER_TEXT', '*'); define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)'); just remove *
Qihun Posted August 25, 2004 Posted August 25, 2004 What will happen if in this line 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); } } you will set $error = false;
Qihun Posted August 26, 2004 Posted August 26, 2004 Easy way to do this is to take for DOB field are already optional (like FAX NUMBER) , if you have fields not in use :D :D :blink:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.