SOWE : Gdpr cookie
SOW plugins are part of Smarty Core, written from scratch!
src/js/sow.core/sow.gdpr.js
Example
A simple GDPR accept cookie!
Able to extend the consent level - see below!
Reload this page to see the example.
<!--
Reset GDPR:
$.SOW.core.gdpr.destroy();
OR BY HASH: #del:gdpr
By hitting 'Accept & Continue' Button, default cookie is set to 0 (all cookies accepted).
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Extending Consent by level (examples):
0 = accept all cookies!
1 = website only
2 = website + advertising
... more if needed
JS USAGE EXAMPLE:
$.SOW.core.gdpr.extend(2); // allow website + advertising
HTML EXAMPLE
<a href="#" class="btn-cookie-extend" data-cookie-level="2">Website + Advertising</a>
BACKEND:
Backend should use '__gdpr' cookie.
The following code should be present on all pages:
-->
<div id="gdpr" class="hide bg-white rounded-lg shadow-lg w-100 max-w-400 p-4 p-lg-5 m-3 rounded-xl position-fixed fixed-bottom start-0 z-index-9999">
<h3 class="fs-5 mb-4 d-flex align-items-center justify-content-lg-between">
Smarty Cookies
<a href="#" class="close mt-n1">
<span class="fi fi-close fs-4" aria-hidden="true"></span>
</a>
</h3>
<p>
We use cookies to improve your experience on our site and to show you personalised ads.
</p>
<a href="#" class="btn btn-primary btn-cookie-accept w-100">
Accept & Continue
</a>
<p class="mb-0 mt-3 small">
<span class="d-block">Need to learn more?</span>
<a href="fullajax-terms.html" class="js-ajax link-muted">Privacy Policy</a>
– and –
<a href="fullajax-privacy.html" class="js-ajax link-muted">Cookie Policy</a>
</p>
</div>