yuxblank 7 Posted January 18, 2019 Posted January 18, 2019 (edited) PrestaShop module for blocking user access by asking to provide their age. It uses prestashop timezone for checking age via Ajax call, uses a cookie to hold the information. Display a form to request user age verification. The front-office will display a modal where user can put his own age, if the age is below threshold the access will be allowed. Configurable age threshold The required age can be configured to meet your requirements Compatibility Tested with PrestaShop 1.6.x https://github.com/yuxblank/only18plus Edited January 18, 2019 by yuxblank (see edit history) Share this post Link to post Share on other sites
freiserk 14 Posted January 19, 2019 Posted January 19, 2019 (edited) Hi. Thank you for your work. I have modified the introduction of the Castilian language in the code and the loading of the module works but I have an error: Accepting the date generates an error by not redirecting to https. In the page inspection if the -- <div class="ac-overlay and <div class="ac-container -- corresponding to the module popup is deleted, the web can be accessed normally. Is it possible to lock the scroll or leave the background in black? Thanks for everything. Edited January 19, 2019 by freiserk (see edit history) Share this post Link to post Share on other sites
yuxblank 7 Posted January 21, 2019 Posted January 21, 2019 (edited) The fix for SSL should be easy, maybe by checking if https is enabled and the pass the baseUrl from public function hookHeader() To the template. Yes the second one can be done of course. Perhaps will be better to check each page refresh by looking for the cookie and the recreate the div container if it's not set. I'll give a check in spare time. Edited January 21, 2019 by yuxblank (see edit history) 1 Share this post Link to post Share on other sites
teknashop 1 Posted January 30, 2019 Posted January 30, 2019 Hello, I would like to know if there is the possibility to match the module "only if a user wants to view a specific category. Let me explain: in my market I have categories of electronics and categories prohibited to minors. My problem is to block only the access of the "forbidden" section. Thank you Ermanno Girardi - teknashop Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 8, 2019 Posted February 8, 2019 Bonjour merci pour le partage, Après installation il ne fonctionne pas ? Share this post Link to post Share on other sites
yuxblank 7 Posted February 9, 2019 Posted February 9, 2019 3 hours ago, Soyons zen said: Bonjour merci pour le partage, Après installation il ne fonctionne pas ? can you provide additional feedback or any error? Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 10, 2019 Posted February 10, 2019 (edited) installation ok, par contre non visible sur le site? installation ok, by cons not visible on the site? PS 1.6.1.23 Edited February 10, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 10, 2019 Posted February 10, 2019 Thank you, ça fonctionne c’était un conflit avec un module Share this post Link to post Share on other sites
yuxblank 7 Posted February 23, 2019 Posted February 23, 2019 Hi, it's available a new release candidate for a new version that supports 1.7.x https://github.com/yuxblank/only18plus/releases/tag/1.0.1-RC If you would like to have a try before i release the final 1.0.1. The new version now also uses prestashop translation system, so i can accept new translations from you. Thanks. Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 23, 2019 Posted February 23, 2019 (edited) Hi my friend, Thank you for this sharing that works ps 1.6 ! Does not work on version 1.7.5.1 ? $this->version = 1.0.0 ?? The activate button does not work Edited February 23, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
yuxblank 7 Posted February 23, 2019 Posted February 23, 2019 (edited) 1 hour ago, Soyons zen said: Hi my friend, Thank you for this sharing that works ps 1.6 ! Does not work on version 1.7.5.1 ? $this->version = 1.0.0 ?? The activate button does not work Umh.. I forgot to change the version number maybe you have to uninstall the older before?.. I tested it with 1.7.5.0 here: https://github.com/yuxblank/only18plus/blob/dfcfaa2a0afdace242207d2076a1128caf6cb206/only18plus.php#L25 try to set 1.0.1 or whatever 😂 Edited February 23, 2019 by yuxblank (see edit history) 1 Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 23, 2019 Posted February 23, 2019 (edited) on the version 1.6 it works, on the version 1.7.5.1 Unable to verify service, please come back later Edited February 23, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
yuxblank 7 Posted February 24, 2019 Posted February 24, 2019 14 hours ago, Soyons zen said: on the version 1.6 it works, on the version 1.7.5.1 Unable to verify service, please come back later Are you on HTTPS? Share this post Link to post Share on other sites
freiserk 14 Posted February 24, 2019 Posted February 24, 2019 On 1.7.5.1 with php 7.2 (1/1) ContextErrorException Notice: Undefined index: base_dir in 7a2ce137dfc5bf120088d91e844a37f11b5f7819_2.file.only18plus.modal.tpl.php line 28 at content_5c729a0660e2e0_25061443(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114 Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 24, 2019 Posted February 24, 2019 (edited) 5 hours ago, yuxblank said: Are you on HTTPS? Hi, yes even on https, problem only on version 1.7.5.1 Edited February 24, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
freiserk 14 Posted February 24, 2019 Posted February 24, 2019 Justo ahora, Soyons zen dijo: Hi, yes even on https problem only on version 1.7.5.1 Hi. Yes, I have https, but in 1.6.1.23 it does not work with https either. Does not recognize the date Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 24, 2019 Posted February 24, 2019 me it works on version 1.6.1.23 Share this post Link to post Share on other sites
yuxblank 7 Posted February 24, 2019 Posted February 24, 2019 HI Guys thanks for you help. I released a new RC https://github.com/yuxblank/only18plus/releases/tag/1.0.1-RC2 Should address most of the problems: Including template rendering exceptions and ability to use it when SSL is active. I tested it again on PS 1.6 and PS 1.7.5.x Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 24, 2019 Posted February 24, 2019 Hi friend, works fine on 1.6, On version 1.7.5.1 it works now except that the popup comes back Share this post Link to post Share on other sites
yuxblank 7 Posted February 24, 2019 Posted February 24, 2019 3 hours ago, Soyons zen said: Hi friend, works fine on 1.6, On version 1.7.5.1 it works now except that the popup comes back Hi. Thank you. I can't reproduce the issue in 1.7.5. Did you can try again by clearing up all the cookies on the browser? The module uses a cookie to hold the information of the approval. Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted February 25, 2019 Posted February 25, 2019 (edited) 12 hours ago, yuxblank said: Hi. Thank you. I can't reproduce the issue in 1.7.5. Did you can try again by clearing up all the cookies on the browser? The module uses a cookie to hold the information of the approval. Hello, yes, it works now I have to clean the cache Edited February 25, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 1, 2019 Posted March 1, 2019 Hello, possible that it works with another prestashop theme ? Share this post Link to post Share on other sites
yuxblank 7 Posted March 1, 2019 Posted March 1, 2019 5 hours ago, Soyons zen said: Hello, possible that it works with another prestashop theme ? It should work with any template, it has it's own style and scripting and does not depends on any prestashop library (excluding jQuery) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 2, 2019 Posted March 2, 2019 Hello, it does not work on the theme that I have, but against the default it works Share this post Link to post Share on other sites
yuxblank 7 Posted March 4, 2019 Posted March 4, 2019 On 3/2/2019 at 3:12 PM, Soyons zen said: Hello, it does not work on the theme that I have, but against the default it works Can you print the console output of the browser? Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 4, 2019 Posted March 4, 2019 45 minutes ago, yuxblank said: Can you print the console output of the browser? I send you the link in PM Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 (edited) Hi, I get this error when trying to use the module. 1.7.5.1 version using HTTPS: Edited March 5, 2019 by CBDwire (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 5, 2019 Posted March 5, 2019 Normally this link would correct this problem https://github.com/yuxblank/only18plus/releases/tag/1.0.1-RC2 Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 2 minutes ago, Soyons zen said: Normally this link would correct this problem https://github.com/yuxblank/only18plus/releases/tag/1.0.1-RC2 No9w this issue again when I try this file: Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 (edited) I'm so confused and frustrated. Every age module I try has some issue. Edited March 5, 2019 by CBDwire (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 5, 2019 Posted March 5, 2019 Look only18plus-1.0.1-RC2 (1).zip Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 This one installs but same issue 😕 Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 (edited) I check the version and it still says RC1.. upgrade says it works but it doesn't change.. I give up Over one month now I try to find a simple working age plugin. It's never going to happen. So frustrated. Edited March 5, 2019 by CBDwire (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 5, 2019 Posted March 5, 2019 TEST only18plus.zip 1 1 Share this post Link to post Share on other sites
CBDwire 1 Posted March 5, 2019 Posted March 5, 2019 6 minutes ago, Soyons zen said: TEST only18plus.zip It's works, thank you so much ❤️ 1 Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 5, 2019 Posted March 5, 2019 👍 1 Share this post Link to post Share on other sites
freiserk 14 Posted March 6, 2019 Posted March 6, 2019 (edited) hace 23 horas, Soyons zen dijo: TEST only18plus.zip This work on 1.7.5.1 perfect. But on 1.6.1.23 - Error: Unable to verify service, please come back later Thanks. Edited March 6, 2019 by freiserk (see edit history) Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 6, 2019 Posted March 6, 2019 1 hour ago, freiserk said: This work on 1.7.5.1 perfect. But on 1.6.1.23 - Error: Unable to verify service, please come back later Thanks. only18plus-1.0.1-RC2 (1) .zip Share this post Link to post Share on other sites
freiserk 14 Posted March 6, 2019 Posted March 6, 2019 hace 2 horas, Soyons zen dijo: only18plus-1.0.1-RC2 (1) .zip Same error. Share this post Link to post Share on other sites
yuxblank 7 Posted March 6, 2019 Posted March 6, 2019 28 minutes ago, freiserk said: Same error. Make sure to regenerate smarty cache. Share this post Link to post Share on other sites
freiserk 14 Posted March 6, 2019 Posted March 6, 2019 hace 5 horas, yuxblank dijo: Make sure to regenerate smarty cache. I clean the smarty cache even manually but nothing. I continue to generate the error in the ajaxCalls.php file: Access to XMLHttpRequest at 'httpss: // myhost.com/modules/only18plus/ajaxCalls.php' from origin 'https://myhost.com' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http , data, chrome, chrome-extension, https. send @ v_50_5b52e8de040a187037133dc20f3c3722.js: 4 If you look at the beginning of the error address it is httpss: // Thanks. Share this post Link to post Share on other sites
yuxblank 7 Posted March 6, 2019 Posted March 6, 2019 (edited) 31 minutes ago, freiserk said: I clean the smarty cache even manually but nothing. I continue to generate the error in the ajaxCalls.php file: Access to XMLHttpRequest at 'httpss: // myhost.com/modules/only18plus/ajaxCalls.php' from origin 'https://myhost.com' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http , data, chrome, chrome-extension, https. send @ v_50_5b52e8de040a187037133dc20f3c3722.js: 4 If you look at the beginning of the error address it is httpss: // Thanks. Thank you i'll address the issue. Try to replace this: https://github.com/yuxblank/only18plus/blob/ce129a5f566db9e8a8333f5e7b6fe930ec7be0bb/only18plus.php#L353 with: return _PS_BASE_URL_SSL_; Edited March 6, 2019 by yuxblank quick fix (see edit history) Share this post Link to post Share on other sites
freiserk 14 Posted March 7, 2019 Posted March 7, 2019 hace 10 horas, yuxblank dijo: Thank you i'll address the issue. Try to replace this: https://github.com/yuxblank/only18plus/blob/ce129a5f566db9e8a8333f5e7b6fe930ec7be0bb/only18plus.php#L353 with: return _PS_BASE_URL_SSL_; Same error, sorry. Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 7, 2019 Posted March 7, 2019 (edited) 3 hours ago, freiserk said: Same error, sorry. what theme do you use and php ? Edited March 7, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
freiserk 14 Posted March 7, 2019 Posted March 7, 2019 hace 1 minuto, Soyons zen dijo: what theme do you use ? default-bootstrap Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 7, 2019 Posted March 7, 2019 and php ? you deactivate all non-presta modules and activate the 18 year module and reset the Share this post Link to post Share on other sites
freiserk 14 Posted March 7, 2019 Posted March 7, 2019 Hi. Php 7.2 and clean install. Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 7, 2019 Posted March 7, 2019 I had the same problem with a module it was a language problem Share this post Link to post Share on other sites
yuxblank 7 Posted March 7, 2019 Posted March 7, 2019 The URL is wrong because the protocol is badly written. I should give a try too see whats wrong If the fix I posted doesn't work. Share this post Link to post Share on other sites
freiserk 14 Posted March 7, 2019 Posted March 7, 2019 ok, many thanks. Share this post Link to post Share on other sites
Soyons Solidaire 249 Posted March 7, 2019 Posted March 7, 2019 (edited) 5 hours ago, yuxblank said: The URL is wrong because the protocol is badly written. I should give a try too see whats wrong If the fix I posted doesn't work. My friend see if you can adapt it with my theme Thank you ! Edited March 7, 2019 by Soyons zen (see edit history) Share this post Link to post Share on other sites
CBDwire 1 Posted March 23, 2019 Posted March 23, 2019 I used this for a while but then mobile users started complaining they could not get past the verification? Any fix for this? Really struggling to find a plugin like this that fully works with desktop and mobile. Thanks for your work. Share this post Link to post Share on other sites
yuxblank 7 Posted November 5, 2020 Posted November 5, 2020 Hi all, i have released a version 1.1 that fixes the issue with url generation with HTTPS 1 Share this post Link to post Share on other sites
freiserk 14 Posted November 8, 2020 Posted November 8, 2020 En 5/11/2020 a las 6:32 PM, yuxblank dijo: Hi all, i have released a version 1.1 that fixes the issue with url generation with HTTPS Many thanks, working. But... After doing the upgrade it always appears again, it does not update the version in the list of modules. Thabks. Share this post Link to post Share on other sites
yuxblank 7 Posted November 8, 2020 Posted November 8, 2020 5 minutes ago, freiserk said: Many thanks, working. But... After doing the upgrade it always appears again, it does not update the version in the list of modules. Thabks. Thanks for pointing that out. I forgot that PS modules need to handle some tasks manually like updating the version in the actual file. 1 Share this post Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now