A consent banner is a cookie notice that appears on websites upon the user’s first visit to the site. Cookie consent banners first started to show up on virtually every website in the EU in response to the ePrivacy Directive of 2002, popularly called “The cookie law”.
According to the Directive, all websites had to give a cookie alert to their users about the fact that they set cookies on the user’s browser. The purpose of cookie consent banners therefore was to alert the users of the website about the cookies and get consent for setting them.
However, the EU legislation regarding cookies and personal data has changed. The cookie notifications are still required, but the requirements have become a lot stricter. To meet this requirements on your PrestaShop store, normally you need a paid module to do the job. There are free modules out there. However they often lack of options to properly configure, or make unnecessary connections to third party websites of the developers.
Installing PrestaShop cookie consent for your store
Here i will show you how to do it properly and for FREE. Go to https://cookieconsent.insites.com and click on the download button.
Configure your cookie consent like position, compliance type, colors etc. Once you finish with configuration, copy the code on the right. Now open your FTP and go to your store, alternatively you can use your cPanel file manager. Navigate to your PrestaShop store folder – themes/classic (or the theme you are using).
Once there, go to templates/_partials folder, download and backup the “head.tpl” file. Open the “head.tpl” with notepad or notepad++ or any other code editor, but don’t use Word or software like this. Once you open the file, scroll to the very bottom of the file, and just after the “{block name=’hook_extra’}{/block}” paste the code you copied earlier.
Save the file and re-upload it to your PrestaShop store folder /themes/classic/templates/_partials.
Note: In order to see the changes in your front office, go to your Back Office -> Advanced Parameters -> Performance. Make sure to set “Recompile templates if the files have been updated” option, and then clear the cache.
That’s it you are done. You now have Cookie Consent popup for free!
I followed all steps but no message is shown in the web site.
Can you help me out?
Thank you
Alex
Did you cleared your PrestaShop cache as explained in the article in the – Back Office -> Advanced Parameters -> Performance and set to “force compile”? Also clear your browser cache and test it under incognito mode. If still don’t work, you have edited the wrong file, and you should check again.
Can’t reproduce
You are not doing it right as described then 🙂
How to do it for Prestashop 1.6.1.11?
There head.tpl file does not exist …
Can you help?
It should be in the header.tpl in your theme folder, inside <.head> <./head> tags, if i remember correctly.
Working perfectly! Thank you!
How long are cookies stored? Where in the code to indicate the storage time?
Hey there thank you for prividing this nice instructions!
Unfortunately i did not work with my Prestashop.
I went to the Back Office -> Advanced Parameters -> Performance and set to “force compile”.
After walking trough the steps many times I realisied that the Code you posted 2019 differentiates in some points with the code i generated.
Could that be the problem? 🙂
Can you help me?
my Code generated:
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
},
"position": "top"
});
Oh sorry thats the Code:
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
},
"position": "top"
});