elleracompany / craft-cookie-consent

GDPR-Compliant cookie consent banner for Craft CMS
Other
6 stars 5 forks source link

Reject all but necessary #104

Closed michalbulla closed 4 months ago

michalbulla commented 1 year ago

Hi there,

If my information are correct, in EU it is shown by law to have the Reject All button displayed, so the customer can reject all but necessary cookies by one click.

Is this possible ?

Thanks

jellingsen commented 1 year ago

Hi,

This should be possible by modifying the template, but we should add it in the example template - and probably a function to handle it in the endpoints.

lexislav commented 5 months ago

Hi, I have solved this by adding a decline all button into the template and modifying default script by adding this code on line 60:


    if (declineAllLinks !== null) {
        if (declineAllLinks.addEventListener) {
            console.log('hooked');
            declineAllsLink.addEventListener("click", submitConsent);
        } else if (declineAllLink.attachEvent) {
            declineAllsLink.attachEvent("onclick", submitConsent);
        }
    }````