Top sellers

  • Delete Orders
    Delete Orders

    Enable the option to delete orders in admin page -> orders Also you...

    $0.00
  • CoolShare
    CoolShare

    Add a social bookmarks with mouse over animation.

    $0.00
  • Categories image
    Categories image

    This module allows you to display the block in the category, but with...

    $0.00
  • Mass price update
    Mass price update

    This module allows you to update quantity or percentage, the prices of...

    $0.00

Recent orders (+)

PrestaSpeed

Received: 06/22/2017 12:05:20
Customer: Fabio
Send to: Milano, Italy
Order value:$55.00
View all ->
Last orders

Received: 06/21/2017 09:59:17
Customer: Dusan
Send to: Praha 2, Czech Republic
Order value:$61.00
View all ->
CSV/TXT/XML Cron Import / Dropshipping

Received: 06/03/2017 00:09:26
Customer: sami
Send to: Mornico al Serio, Italy
Order value:$48.95
View all ->
RSI SEO

Received: 05/30/2017 11:20:30
Customer: Rudy
Send to: Courbevoie, France
Order value:$35.00
View all ->
PrestaProtect Captcha+ / malware scanner / block bots

Received: 05/26/2017 11:46:51
Customer: Damiano
Send to: Stäfa, Switzerland
Order value:$43.00
View all ->

In this tutorial, we show a code to restrict the user the age of 18 as the minimum age.

To do this, the validation class (class / Validation.php) that birthday check is used. But we use the override to avoid modifying core files of PrestaShop.

First, create a new php file called Validation.php, and put this content:

class Validate extends ValidateCore {
public static function isBirthDate($date)
{
if (empty($date) || $date == '0000-00-00')
return false;
if (preg_match('/^([0-9]{4})-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[1-2][0-9])|(?:3[01]))([0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date))
{
if ((floor((time() - strtotime($date))/31556926))<18)
return false;
if ($birth_date[1] > date('Y') && $birth_date[2] > date('m') && $birth_date[3] > date('d'))
return false;
return true;
}
return false;
}
}

and copy this file to overrides/classes directory of PrestaShop. After that, delete the file cache/class_index.php to load the new override and thats all