Cookie bar code problem

Highlighted
Explorer
68 0 12

Hi,

I followed this tutorial to get a cookie bar on my website without an app (https://easycodeguide.com/shopify-add-eu-cookies-banner-website-without-app) but when I click AGREE it does not close the cookie bar and instead takes me to a blank page with about:blank#blocked as the URL. When I right click it and choose copy link URL it shows some Javascript: SE_CloseCookiesWindow which is in the code, but I don't know how to fix it. 

Here's the full code: 

{% assign text = "We use cookies to ensure that we give you the best experience on our website. If you continue we'll assume that you are understand this." %}
{% assign more_info = "LEARN MORE" %}
{% assign privacy_url = "https://findsteals.com/policies/privacy-policy" %}
{% assign button_text = "AGREE" %}
<style type="text/css">
    @-webkit-keyframes slideUp{
        0%{
            -webkit-transform:translateY(66px);
            transform:translateY(66px)
        }
        100%{
            -webkit-transform:translateY(0);
            transform:translateY(0)
        }
    }
    @keyframes slideUp{
        0%{
            -webkit-transform:translateY(66px);
            -ms-transform:translateY(66px);
            transform:translateY(66px)
        }
        100%{
            -webkit-transform:translateY(0);
            -ms-transform:translateY(0);
            transform:translateY(0)
        }
    }
    #se-cookies-message {
        color: #1E3F63; /* Change text color here */
        background-color: #EBEBEB; /* Change background color here */
        padding: 10px;
        text-align: center;
        position: fixed;
        bottom:0px;
        left:0;
        right:0;
        z-index: 100000;
        box-shadow: 0 0 5px rgba(0,0,0,0.4);
        opacity: 0;
        visibility: hidden;
        font-size: 12px;
    }
    #se-cookies-message.se-cookies-message-open {
        opacity: 1;
        visibility: visible;
        animation-duration:0.8s;
        -webkit-animation-duration:0.8s;
        -moz-animation-duration:0.8s;
        -o-animation-duration:0.8s;
        -webkit-animation-name:slideUp;
        animation-name:slideUp;
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        -moz-align-items: center;
        -ms-align-items: center;
        -o-align-items: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-justify-content: space-between;
        -moz-justify-content: space-between;
        -ms-justify-content: space-between;
        -o-justify-content: space-between;
        justify-content: space-between;
    }
    #se-accept-cookies-checkbox {
        color: #ffffff; /* Change button text color here */
        background-color: #1E3F63; /* Change button background color here */
        transition: background 200ms ease-in-out,color 200ms ease-in-out,box-shadow 200ms ease-in-out;
        -webkit-transition: background 200ms ease-in-out,color 200ms ease-in-out,box-shadow 200ms ease-in-out;
        border-radius: 5px;
        -webkit-border-radius: 5px;
        text-decoration: none;
        font-size: 12px;
        padding: 8px 15px;
    }
    #se-accept-cookies-checkbox:hover {
        opacity: 0.8;
    }
    .se-cookies-text {
        padding-right: 15px;
    }
    @media screen and (min-width: 768px) {
        #se-cookies-message {
            padding: 15px 30px;
            font-size: 17px;
        }
        #se-accept-cookies-checkbox {
            font-size: 16px;
            padding: 8px 30px;
        }
        .se-cookies-text {
            padding-right: 0;
        }
    }
</style>
<div id="se-cookies-message-container">
    <div id="se-cookies-message">
        <div class="se-cookies-text">
            {{text}} <a href="{{https://findsteals.com/policies/privacy-policy}}">{{more_info}}</a>
        </div>
        <a href="javascript&colon;SE_CloseCookiesWindow;" id="se-accept-cookies-checkbox">{{button_text}}</a>
    </div>
</div>
<script>
  function SE_setCookie (name, value, days) {
    var expires = "";
    if (days) {
      var date = new Date();
      date.setTime(date.getTime() + (days*24*60*60*1000));
      expires = "; expires=" + date.toUTCString();
    }
    document.cookie = name + "=" + (value || "")  + expires + "; path=/";
  }
  function SE_getCookie (name) {
    var pair = document.cookie.match(new RegExp(name + '=([^;]+)'));
    return !!pair ? pair[1] : null;
  }
  var cookiesName = 'cookies_accepted';
  function SE_CheckCookies () {
    if(!SE_getCookie(cookiesName)) {
      var cookies_message = document.getElementById("se-cookies-message");
      cookies_message.className += " se-cookies-message-open";
    }
  }
  function SE_CloseCookiesWindow () {
    SE_setCookie(cookiesName, true, 9999);
    document.getElementById("se-cookies-message-container").removeChild(document.getElementById("se-cookies-message"));
  }
  document.addEventListener('DOMContentLoaded', function () {
    SE_CheckCookies();
  });
</script>

URL: findsteals.com

Would anyone know how to fix this little issue? 

Thanks! 

0 Likes