{% sw_extends '@@Storefront/storefront/base.html.twig' %}
{% block base_body_script %}
{{ parent() }}
{% set swCookies = page.extensions.smartsuppCookies.key == 1 %}
{% set Key = page.extensions.smartsuppConfiguration.key %}
{% set hasKey = Key is defined and Key != '' %}
{% set Color = page.extensions.smartsuppColor.key %}
{% set hasColor = Color is defined and Color != '' %}
{% set Config = page.extensions.smartsuppConfig.key %}
{% set hasConfig = Config is defined and Config != '' %}
{% set Api = page.extensions.smartsuppApi.key %}
{% set hasApi = Api is defined and Api != '' %}
{% if hasKey %}
<script id="smartsupp_live_chat" key="{{ Key }}"{% if hasColor %} color="{{ Color }}"{% endif %}{% if hasConfig %} config="{{ Config }}"{% endif %}{% if hasApi %} api="{{ Api }}"{% endif %}>
function getCookie(name) {
var cookieMatch = document.cookie.match(name + '=(.*?)(;|$)');
return cookieMatch && decodeURI(cookieMatch[1]);
}
var ssCookieFcn = getCookie('cookieSmartsuppFunctional'),
ssCookieSts = getCookie('cookieSmartsuppStatistics'),
ssCookieMkt = getCookie('cookieSmartsuppMarketing')
{% if swCookies %}
if (ssCookieFcn != null) {
var _smartsupp = _smartsupp || {};
_smartsupp.key = '{{ page.extensions.smartsuppConfiguration.key }}';
_smartsupp.pluginVersion = '1.0.1';
_smartsupp.offsetY = 65;
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='//www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
if (ssCookieSts != null) {
smartsupp('analyticsConsent', true);
} else {
smartsupp('analyticsConsent', false);
}
if (ssCookieMkt != null) {
smartsupp('marketingConsent', true);
} else {
smartsupp('marketingConsent', false);
}
{% if hasColor %}
_smartsupp.color = '{{ Color }}';
{% endif %}
{% if hasConfig %}
{{ Config }}
{% endif %}
{% if hasApi %}
{{ Api }}
{% endif %}
}
{% else %}
var _smartsupp = _smartsupp || {};
_smartsupp.key = '{{ Key }}';
_smartsupp.pluginVersion = '1.0.1';
_smartsupp.offsetY = 65;
{% if hasColor %}
_smartsupp.color = '{{ Color }}';
{% endif %}
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='//www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
smartsupp('analyticsConsent', true);
smartsupp('marketingConsent', true);
{% if hasConfig %}
{{ Config }}
{% endif %}
{% if hasApi %}
{{ Api }}
{% endif %}
{% endif %}
</script>
{% endif %}
{% endblock %}