Forums / General Questions / age verification to enter shop?

age verification to enter shop?

Locked

Started by h_2_o on 3 Jan 2010, 6:19 AM · Views: 6,367

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
3 Jan 2010, 6:19 AM
#1
h_2_o avatar

h_2_o

New Zenner

Join Date:
Jan 2009
Posts:
20
Plugin Contributions:
0

age verification to enter shop?

I'm helping out a friend who has a small vinyard setup a small online shop with his wines. We were talking with his lawyers about the whole age thing with drinking and selling online. We were told that we do not need to age verify the entry into the zen cart shop, but doing so would not hurt in case any legal troubles came up. Is there a way to put up an "are you 21 or over" type of cookie in zen much the way the ######## sites do as an example? His way of looking at it is he is small enough that he would rather overdo it a little rather than get any AG on his case about it.

thanks

3 Jan 2010, 11:16 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: age verification to enter shop?

Admin>>>Configuration>>>Customer Details>>>Date of Birth...

... Set to "true"

20 years a Zencart User

3 Jan 2010, 5:52 PM
#3
h_2_o avatar

h_2_o

New Zenner

Join Date:
Jan 2009
Posts:
20
Plugin Contributions:
0

Re: age verification to enter shop?

that is for customer verification, we are looking more for a "are you 21" to even enter the store.

thanks for the help

3 Jan 2010, 6:16 PM
#4
stevesh avatar

stevesh

Black Belt

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

Re: age verification to enter shop?

You could create an index.html file that would go in the root directory of your site that would require that the visitor acknowledge that he is 21 before entering the site, but there is no way to verify that he is telling the truth, and his acknowledgment wouldn't be logged anywhere, so I'd say it would be a waste of time. I wouldn't bother.

I think the various delivery options (UPS, FEDEX, etc.) have age verification options?

3 Jan 2010, 7:39 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: age verification to enter shop?

I'm 18...

You have a checkbox that says "Are you 21?"

I check the box to say "yes"...

... and away I go....

20 years a Zencart User

3 Jan 2010, 7:44 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: age verification to enter shop?

The easiest way around this is to REQUIRE that people checking out have read your Terms and Conditions.

Admin>>>Configuration>>>Regulations

In this document (T&C's) you explicitly state that you will not knowingly sell to people under the age of 21, and that people who click to "accept" your T&C's verify that they are of legal age to purchase the products...

Your T&C's page is a DEFINE PAGE...

20 years a Zencart User

4 Jan 2010, 1:04 AM
#7
h_2_o avatar

h_2_o

New Zenner

Join Date:
Jan 2009
Posts:
20
Plugin Contributions:
0

Re: age verification to enter shop?

OK i understand that even a 2 year old able to click a mouse can easily bypass and that in all reality it is worthless. However instead of taking advice from myself or the random person on the internet saying it is a waste of time, his lawyers advised him to CYA and because he is a small business he doesn't want to upset the govt and if that means a meaningless added click for a browser then that is fine with him.

With that out there, are there any inherent problems with putting an index.html in the same folder as the root of the zen cart itself?

4 Jan 2010, 1:31 AM
#8
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Re: age verification to enter shop?

I think its not so important that people can lie or cheat. Its more a legal issue, that people are informed that it is only for adults (21 and above) and the acknowledge that they know this. Thus, if you have an entry page that asks the customer for his or her age. I believe you need to set a cookie so you can validate this in "application_top.php" for each link to your website. Once this things was accepted, you display your store.

So my suggestion is that you check for a cookie new the includes/application_top.php close to the beginning of the file. If there is this cookie, than continue normal operation. Otherwise redirect to another page with the age verification (or use an div overlay). Once this checkbox was ticked, write the cookie and hide th eoverlay or redirect to the start page of your shop.

4 Jan 2010, 2:27 AM
#9
sheryll avatar

sheryll

New Zenner

Join Date:
Dec 2009
Location:
New York, NY
Posts:
45
Plugin Contributions:
0

Re: age verification to enter shop?

Hi Tino,

This is exactly what I'm looking for. Do you think you can give a detailed tutorial as to how to do this?

Thanks!

4 Jan 2010, 3:11 AM
#10
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Re: age verification to enter shop?

Hi again, not a detailed tutorial. I can give you some more general instructions and the buildings blocks how to achieve this.

First the modal dialog, which is more modern than redirecting to another website.

THere is a nice jquery plugin called JQuery BlockUI Plugin.

Than you have to read and write cookies which can be dont with this function in PHP

The code is from here without the base64 encryption.

/*
@param $name - Name of Cookie
@param $default - Default value, if the specified cookie does not exist
*/
function readCookie($name, $key = null, $default=null){
    if(isset($_COOKIE[$name])){        
        $val = $_COOKIE[$name];
        return $val;
    }else{
        return $default;
    }
}

Check for the value of the cookie

$ageCheck = readCookie('AgeVerification');

if (is_null($ageCheck) || $ageCheck != '>21' ) 
{
   //show the modal window with the age verification text, read the tutorial about the jquery BlockUI Plugin how too show this. 
} 

Later you have to write a cookie with javascript or php after the age verification checkbox was clicked on the Modal Dialog and close the dialog.

/*
@param $name - Name of cookie
@param $val - Value of the cookie
@param $time - Life of the cookie in seconds
@return TRUE on success else FALSE
*/
function writeCookie($name, $val, $time = null){
    $time = is_null($time) ? $GLOBALS['cookieLife'] : $time;    
    // Save the cookie if header is not already sent
    if(!headers_sent()) {
        return setcookie($name, $val, time() + $time, '/');
    }else{
        return FALSE;
    }
} 
writeCookie('AgeVerification','>21', 60*24*7); // that lasts a week, so visitors see the age check after a week again. Check the age as you like.

Thats about it. The code has to be added in includes/application_top.php

The javascript files for the plugin and jquery should be copied to /includes/templates/YOUR_TEMPLATE/jscript/

4 Jan 2010, 5:17 AM
#11
h_2_o avatar

h_2_o

New Zenner

Join Date:
Jan 2009
Posts:
20
Plugin Contributions:
0

Re: age verification to enter shop?

tino, thank you very much for your help, you knew exactly what and why i was looking for it.

5 Jan 2010, 7:40 AM
#12
sheryll avatar

sheryll

New Zenner

Join Date:
Dec 2009
Location:
New York, NY
Posts:
45
Plugin Contributions:
0

Re: age verification to enter shop?

Tino, thank you so much! This is a great elaboration. It seems pretty straightforward and I'll give it a shot! Thanks again. =]