Search the Community
Showing results for tags 'age'.
-
Hi everyone, I'm finding some difficulties on making a restricted registration for user under 18 on an ecommerce. Problem is that PS 1.7's architecture has changed from 1.6 so all the solutions I've found are not working. For example I tried to replace the function isBirthDate with the following (found in a topic on this forum): public static function isBirthDate($date, $format = 'Y-m-d') { 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; } I also tried to integrate it with the existing code but, even tho apparently it was working , I can't understand if it really checks the age now but apparently it completely breaks the format and doesn't recognize it anymore, cause even if I put the right converted format DD/MM/YYYY or any kind of format it gives me an error which states that the format is wrong. Now this is the "stock" code of the function: public static function isBirthDate($date, $format = 'Y-m-d') { if (empty($date) || $date == '0000-00-00') { return true; } $d = DateTime::createFromFormat($format, $date); if (!empty(DateTime::getLastErrors()['warning_count']) || false === $d) { return false; } return $d->getTimestamp() <= time(); } I'd also like to know if that "return true" is right or not. Cause I think it should return false for that condition. TL;DR: I can't find a way to make age restricted registration in a prestashop ecommerce 1.7.6.2 via php ( so no modules/addon to buy). I tried old solutions but obviously they won't work. Thanks for your attention.
- 3 replies
-
- validate
- restriction
-
(and 2 more)
Tagged with:
-
PHP age restriction on creating account PrestaShop 1.7.6.2
AleShey posted a topic in Core developers
I'm sorry for the repost but I guess this thread section is more appropriate Hi everyone, I'm finding some difficulties on making a restricted registration for user under 18 on an ecommerce. Problem is that PS 1.7's architecture has changed from 1.6 so all the solutions I've found are not working. For example I tried to replace the function isBirthDate with the following (found in a topic on this forum): 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; } I also tried to integrate it with the existing code but, even tho apparently it was working , I can't understand if it really checks the age now but apparently it completely breaks the format and doesn't recognize it anymore, cause even if I put the right converted format DD/MM/YYYY or any kind of format it gives me an error which states that the format is wrong. Now this is the "stock" code of the function: public static function isBirthDate($date, $format = 'Y-m-d') { if (empty($date) || $date == '0000-00-00') { return true; } $d = DateTime::createFromFormat($format, $date); if (!empty(DateTime::getLastErrors()['warning_count']) || false === $d) { return false; } return $d->getTimestamp() <= time(); } I'd also like to know if that "return true" is right or not. Cause I think it should return false for that condition. TL;DR: I can't find a way to make age restricted registration in a prestashop ecommerce 1.7.6.2 via php ( so no modules/addon to buy). I tried old solutions but obviously they won't work. Thanks for your attention. -
Buenas, estoy buscando un módulo que muestre un popup al entrar en una categoría específica o al clicar en el botón de compra de un producto alcohólico y que permita verificar la mayoría de edad del usuario que está comprando. La mayoría de los módulos que he encontrado son de popups que se muestran al entrar en la página, pero necesitaría uno que se mostrase únicamente cuando entras en una categoría, por ejemplo, "alcohol" o si hubiese uno que fuese al clicar en "añadir al carrito" estaría mucho mejor. Mi versión de prestashop es la 1.7.3.0 No me importaría si fuese de pago. Gracias.
-
I just started my new business TeaTan and built the site on PrestSHOP because I thought it was easy to use and clean. I have a couple questions as I finish the site. 1. It asks for the users age when checking out, can I remove this? 2. It asks for two phone numbers in the check out, we just need one 3. On the page after you finish the sign up it says here is your orders but nothing show up unless you refresh the page. How can I edit that page to tell the customer to refresh it to show new orders. Or is there a way to have that page auto refresh once? Thanks for the help and look forward to years of PrestaSHOP happiness
-
Hello, I found this great age verification system at age-verify.com and it asks to put this code in index.html or home.html under the <HEAD> section: <script type="text/javascript" src="http://age-verify.com/scripts/18A.js"></script> The issue is I don't find the right file where to put it in Prestashop 1.6.0.6 Any idea which file to paste it into?
- 5 replies
-
- age verification
- age
-
(and 2 more)
Tagged with:
-
Remove age from registration form and add custom fields
alexshimov posted a topic in Core developers
Hi everyone! How can I remove fields month, day and year from registration form? All I really need is First Name, Last Name, Phone number, Email address and those checkboxes with mail subscription. And I need to add a custom text field for the phone number. How could I do that? Thank you! -
Bonjour, Je suis ici à la recherche de modules pour ma boutique, j'ai déjà fait quelques recherches depuis 1 ou 2 jours mais sans succès, c'est pourquoi j'en viens donc a demander votre aide. J’aurais besoin de deux modules, ou même si un module fait les deux , du moment que mes demandes sont remplie! En premier temps, il me fraudais un module me permettant de "fermer" ma boutique de lui créer des horaires ! que je puisse régler, tel jour de tel heure a tel heure ils peuvent acheter, un autre jour un intervalle de temps différent. le deuxième serait un module, qui lors de l'arriver d'un visiteur sur le site lui ferait rentrer sont âge ( pour la vérification d'âge légal, car mon site est un site de vente d'alcool. ) Ainsi que le code postale d'ou il aimerait être livré puisque mon entreprise ne livre pas partout en France et que nous avons des sites différents selon le code postal, par exemple lorsque le client rentre 59000 ou 59160 il arrive sur notre site de Lille ou s'il rentre 06000 il arrive sur le site de Nice. Si vous connaissez des modules qui ont déjà ces fonctionnalités, je vous remercierais de me les recommander. Sinon, si un développeur est prêt à travailler, je serais prêt à le payer bien évidemment. EDIT: Je suis sous prestashop 1.6 Merci, Thomas
-
Anyone know of a good age verification popup to use on the front end of my site.... Have one now,, but can't put in my logo, and it drops you off at the bottom of the site once you verify your age. Or does anyone know how to fix it... have tried to get the developer to help me, but he does not return emails to me. Thanks in advance,,, Brian
-
Hi, im searching for a module or tweak that allow me to block access to shop according to age.( to avoid youngs buyers) If there is nothing i would like to get suggestion to do one.