You know sometimes you just want a quick solution to a problem and wherever you look there are just complex, overpriced scripts that make your simple problem sound like something that needs a lot of code and money to get to work.
Download the code from Github here
Whatever your opinion of the EU Cookie Law which came into effect in 2012, sooner or later if you are in Europe you may need to show that you are doing something about it. Err actually it’s 2014, so I guess we are already a teeny weeny bit late.
From what I understand the law may differ in various countries (certainly outside Europe), so depending on where your website is, and who visits your site the law may or may not apply to you.
You can implement this solution on any website by copying the install files to your web server and adding the following code to the footer of your site.
This sets up some variables used by the script, the URL of the privacy info page, the lifetime of the cookie used by the script in days, messages displayed, the option to fade the message automatically and the path to the install folder – used to display the close image.
For wordpress simply paste this into the footer php file of your theme.
<?php if (empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] = ‘off’): ?>
Here I am manually checking the store id and translating the text to German. Remember to refresh your Magento cache after editing and saving the footer template file.
You can see the code working on this WordPress blog below, and also with Magento on my Magento development site.
Tested with Magento 1.8.x, WordPress 3.blah, Chrome, Firefox, IE11. Detects mobile devices and modifies banner size accordingly.