{% if j3 is not defined %}
  <style>
    body {
      display: none !important;
    }
  </style>
  <script>
    window.location = 'index.php?route=opencartvip/startup/error';
  </script>
{% endif %}
{{ j3.loadController('opencartvip/layout', 'bottom') }}

{% if not j3.document.isPopup() %}

<footer class="top-row">
  {{ footer_menu }}
</footer>

{% endif %}
</div><!-- .site-wrapper -->

{{ j3.loadController('opencartvip/layout', 'bottom_menu') }}

{{ j3.loadController('opencartvip/layout', 'side_menu') }}

{{ j3.loadController('opencartvip/layout', 'notification') }}

{% for script in j3.document.getScripts('footer') %}
<script src="{{ j3.document.staticUrl(script, false) }}" {% if j3.settings.get('performanceJSDefer') %} defer {% endif %}></script>
{% endfor %}

{% if j3.canLiveReload() %}
<script src="http://{{ j3.getHost() }}:35729/livereload.js?snipver=1" async></script>
{% endif %}

{% if j3.settings.get('customJS') %}
<script type="text/javascript">{{ j3.settings.get('customJS') }}</script>
{% endif %}

{% if not j3.document.isPopup() and j3.settings.get('customCodeFooter') %}
{{ j3.settings.get('customCodeFooter') }}
{% endif %}

{% if not j3.document.isPopup() and j3.settings.get('scrollTop') %}
<div class="scroll-top">
  <i class="fa fa-angle-up"></i>
</div>
{% endif %}

{% if j3.document.hasFonts() and j3.settings.get('performanceAsyncFontsStatus') %}
  <script>
    (function () {
      var wf = document.createElement('script');
      wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
      wf.type = 'text/javascript';
      wf.async = 'true';
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(wf, s);
    })();
  </script>
{% endif %}


<script>
$(document).ready(function() {
  islPromotionsPing(100);

  // Instead of watch addCart button, monitor the xhr
  $(document).ajaxComplete(function(e, xhr, settings) {
    if (xhr.status != 200) {
      return;
    }
    if (settings.url.indexOf('checkout/cart/add') != -1 || settings.url.indexOf('checkout/cart/remove') != -1) {
      islPromotionsPing(300, {"ntf_success" : true});
    }
  });
});
function islPromotionsPing($timeout, $param) {
  if ($param == undefined) {
    $param = [];
  }

  $('.islpr-alert').remove();
  setTimeout(function() {
    $.ajax({
      url      : 'index.php?route=extension/module/promotions/ping',
      type     : 'post',
      dataType : 'json',
      data     : $param,
      success: function(data) {
        if (data) {
          $.each(data, function(key, value) {
            $('#content').prepend('<div class="alert alert-' + value.alert + ' islpr-alert islpr-alert-' + value.theme + '">' + value.message + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
          });
        }
      }
    });
  }, $timeout);
}
</script>
</body>

      <div id="cookie-notice" class="cookie-notification">
	<div class="container">
		<div class="wp-block-column cookie-content">
			<div class="ct-cookies-content">Alışveriş sitemizde, kullanıcı deneyimini geliştirmek ve internet sitesinin verimli çalışmasını sağlamak amacıyla çerezler kullanılmaktadır. Daha detaylı bilgi için <a href="/cerez-politikasi" target="_blank">Çerez Politikası</a> sayfamızı ziyaret edebilirsiniz.</div></div>
			<button class="ct-accept float-right" onclick="acceptCookie();">Kabul Et</button><button class="ct-close" onclick="myFunction()" >×</button>
  </div>
</div>
      <style>
.cookie-notification {
	position: fixed;
	left: 0;
	bottom: 0;
	z-index: 999999;
	color: #fff;
	visibility: hidden;
}

.cookie-notification a:hover {
	color: #fff;
}

.wp-block-column.cookie-svg {
	max-width: 20%;
	float: left;
	margin-right: 10px;
}

@media (max-width:479.98px) {
	.cookie-notification>div {
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-ms-flex-direction: column;
		flex-direction: column;
	}
}

@media (max-width:689.98px) {
	.cookie-notification {
		right: 0;
	}
	.cookie-notification>div {
		display: -webkit-box;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-align: center;
		-ms-flex-align: center;
		align-items: center;
		padding-top: 15px;
		padding-bottom: 15px;
	}
}

@media (max-width:689.98px) {
	.cookie-notification {
		background: #fff;
	}
}

@media (min-width:690px) {
	.cookie-notification {
		padding: 0 25px 60px 5px;
	}
	.cookie-notification .ct-cookies-content {
		margin-bottom: 15px;
	}
}

.cookie-notification .container {
	position: relative;
}

@media (max-width:689.98px) {
	.cookie-notification .container {
		width: 88%;
		margin: 0 auto;
	}
}

@media (min-width:690px) {
	.cookie-notification .container {
		background: #fdfdfd;
		-webkit-box-shadow: 0 5px 30px -5px rgba(34, 56, 101, .15);
		box-shadow: 0 0px 8px 2px rgb(0 0 0 / 28%);
		padding: 25px;
		border-radius: 3px;
		max-width: 330px;
		min-height: 160px;
	}
}

.cookie-notification .ct-cookies-content {
  font-family:inherit;
	color: #000;
	line-height: 1.4;
}

.cookie-notification .ct-cookies-content a {
	text-decoration: none;
	color: #115cfa;
}

@media (max-width:479.98px) {
	.cookie-notification .ct-cookies-content {
		text-align: center;
		margin-bottom: 15px;
	}
}

@media (max-width:689.98px) {
	.cookie-notification .ct-cookies-content {
		font-size: 12px
	}
}

@media (min-width:690px) {
	.cookie-notification .ct-cookies-content {
		font-size: 13px;
	}
}

.cookie-notification .ct-accept {
	color: #fff;
	background: #ffc000;
	border: 0;
	padding: 0 20px;
	height: 35px;
	border-radius: 3px;
	cursor: pointer;
	text-transform: capitalize;
	--buttonShadow: none;
	--buttonTransform: none;
}

.cookie-notification .ct-accept:hover {
background: #28a745;
}

@media (max-width:479.98px) {
	.cookie-notification .ct-accept {
		width: 100%;
	}
}

@media (min-width:480px) and (max-width:689.98px) {
	.cookie-notification .ct-accept {
		margin-left: 20px;
	}
}

.cookie-notification .ct-close {
	color: #000 !important;
	position: absolute;
	top: 0;
	right: 0;
	border: 0;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	font-size: 17px;
	width: 45px;
	height: 45px;
	padding: 0;
	opacity: .5;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: 0 0;
	-webkit-transition: opacity .2s ease;
	transition: opacity .2s ease;
}

.cookie-notification .ct-close:focus {
	outline: 0;
}

.cookie-notification .ct-close:hover {
	opacity: 1;
}

@media (max-width:689.98px) {
	.cookie-notification .ct-close {
		display: none;
	}
	.wp-block-column.cookie-svg {
		display:none;
	}
}
      </style>
      <script>
      function acceptCookie() {
                document.cookie = "cookieaccepted=1; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/", document.getElementById("cookie-notice").style.visibility = "hidden"
            }
            document.cookie.indexOf("cookieaccepted") < 0 && (document.getElementById("cookie-notice").style.visibility = "visible");
function myFunction() {
  document.getElementById("cookie-notice").style.visibility = "hidden";
}
      </script>
      
</html>
