Daniel.de Posted January 6, 2020 at 04:12 PM Share Posted January 6, 2020 at 04:12 PM Hi there, I try to use the developement filter "Cookie Consent" from documentation: function disable_cookie_consent_features($consent) { $cookieName = 'cookieconsent_status'; if ( !isset($_COOKIE[$cookieName]) || ( isset($_COOKIE[$cookieName]) && $_COOKIE[$cookieName] !== 'dismiss' ) ) { $consent = false; } return $consent; } Clickfwd\Hook\Filter::add('cookie_consent', 'disable_cookie_consent_features', 10); This works fine until I activate my page cache system. Is there a way to combine this php code with JQuery like: <script> jQuery(function ($test) { var cookievalue = Cookies.get("cookie_consent"); var marketing_cookie = 'marketing":false'; if (cookievalue == null) { echo '<?php $consent = false;return $consent; ?>'; } else { console.log('Klaro existiert'); if(cookievalue.indexOf(marketing_cookie) != -1) { echo '<?php $consent = false;return $consent; ?>'; } else { console.log('test2'); }; } }); </script> In this way the script could load if cache is activated, also, isn't it? Maybe someone has an idea. Best regards, Daniel Link to comment
Alejandro Posted January 6, 2020 at 06:59 PM Share Posted January 6, 2020 at 06:59 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Daniel.de Posted January 7, 2020 at 10:49 PM Author Share Posted January 7, 2020 at 10:49 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts