Jump to content

Lightbox on homepage to challenge under 18 users and redirect on negitive responce?


Recommended Posts

I run an adult novelty store, it has no nudity but still we would like to discourage anyone under 18 from viewing the content.

What I would like is a lightbox that pops up when you first visit prestashop, with age restriction information an image and two buttons to choose; "I'm an adult"(this button closes the lightbox), "I'm not an adult"(this button redirects). I'm not great with code, however I can fumble my way through with a little help from my good friends here I believe.


What i need to get started.

What file should I edit to start testing code?
Is it possible to use an ajax lightbox that comes with prestashop?
Is it possible to create a cookie so return users don't have to see this page again?

Please feel free to offer input, and if you already have the code necessary could you share it?

Link to comment
Share on other sites

  • 2 weeks later...

hi.

you would like that this window comes for each customer once?
so it would be a idea to use some db-fields already available (and also some code snippets already there).

maybe you'd like to use the optin field in ps_customer or, if you'd like to force each potential customer to register, you could use the birthday field to validate.

but, because it don't depends where you store this information, you'll have to start with init.php

if (is_numeric($cookie->id_cart))


take this and create your function like if ($cookie->is_adult == '1') ... else echo 'lightbox adult check' ...

you need to modify the cookie class, so that it can set and read the adult variable and you will have to create a function that uses the parameter from the lightbox window to set the is_adult.

greetings

Link to comment
Share on other sites

Hi thanks for your reply. I just want to show a warning so that we protect our business from legal problems (detour minors from viewing). I don't think we want to force any sign-up that turns potential customers away.

So I create a cookie variable. (not quite sure where this is located)
is_adult


Then I add this code to the init.php
if ($cookie->is_adult == ‘1’) … else echo ‘lightbox adult check’ …


How do I store the cookie information in the database? Or do I even need to?


Thanks for the help, sadly I'm still a bit confused how to apply this.

Link to comment
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
×
×
  • Create New...