Easy tools for allow/decline cookies.
On the client side, it is necessary to link CookiesConsent.js, cookiesConsent.css and also jQuery (>= 1.12.4). And the last step is to initialize and call the CookieConsent Modal.
Show settingsOn the server side it is necessary to set the package to your project, you can do it in 3 steps.
Show settingAll process you can make in 4 steps.
CookiesConsent.js, cookiesConsent.css
<link href="./styles/cookiesConsent.css" type="text/css" rel="stylesheet">
<script src="./js/cookiesConsent.js"></script>
<script>
cookiesConsent = new CookiesConsent();
cookiesConsent.init();
cookiesConsent.setDefaultLang('cs')
</script>
Upload your config.json to folder config.
Set your script to type="text/plain" and set data-cc_category="{{YourCategoryOfScript}}"
Example:
public function handleSendCookieConsent() {
$data = $this->getHttpRequest()->getPost('data');
$cookie = new CookieConsent();
$cookie->setToken('a322d7c87373842f6efcb318fe31ee73');
$cookie->setData($data);
$cookie->send();
}