Zen Cart Logo
Forums / General Questions / Age Limit FAQ CODE NOT WORKING

Age Limit FAQ CODE NOT WORKING

Locked

Views: 793

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
29 Aug 2009, 9:39 PM
#1
vpr2go avatar

vpr2go

New Zenner

Join Date:
Aug 2009
Posts:
1
Plugin Contributions:
0

Age Limit FAQ CODE NOT WORKING

I can not get the age limit FAQ code to work. That and I don't understand the FAQ's

then create an over-ride file for your includes/languages/english/create_account.php file and place the following line in there, changing the text to suit your style of feeding errors back to visitors

I have read through all the FAQ's relating to this topic and still cannot figure this out. I am selling e-cigs and really need this function to work.

I first tried to edit the code in create_account.php with the new code that FAQ's says to put in it.

if (ACCOUNT_DOB == 'true') {
if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
$minimum_age = 18;
$acceptable_dob = (date('Y') - $minimum_age) . date('md');
if (zen_date_raw($dob) > $acceptable_dob) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_UNDERAGE);
}
}
}
I uploaded it to my page and got a blank page when I tried to access the login.

I guess what I'm trying to figure out is how to get the overide page set up correctly as far as coded correctly and put in the correct folder to where create_account.php references the information.

I also would like to know if anyone else understand this part of the FAQS of creating an age limit at signup.

Any help would eb greatly appreciated. Not sure how to fix this.

30 Aug 2009, 1:32 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Age Limit FAQ CODE NOT WORKING

You probably accidentally added a space or line to the end of the file when you edited it.

Is this really worth the effort in the first place? All it does is check the date of birth the visitor entered to see if it is more than 18 years ago. It can't (obviously) check for phony dates entered, and no agreement by the visitor is stored in the database.

30 Aug 2009, 1:38 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Age Limit FAQ CODE NOT WORKING

Zen Cart does have a switch to enable forcing the customer to click to accept terms and conditions, and you could use this to prove that they confirmed their age was over 18 (which is all you can do, short of a secure identity check).