{% sw_extends '@Storefront/storefront/base.html.twig' %}
{% block base_header_inner %}
{% sw_include '@WbfkThemeMMedientechnik/storefront/component/pre-header.html.twig' %}
{{ parent() }}
{% endblock %}
{% block base_main %}
{% sw_include '@WbfkThemeMMedientechnik/storefront/component/floating-chat-telefon.twig' %}
{% sw_include '@WbfkThemeMMedientechnik/storefront/component/change-language-modal.html.twig' %}
{{ parent() }}
{% endblock %}
{% block base_footer %}
{{ parent() }}
{% sw_include '@WbfkThemeMMedientechnik/storefront/component/footer.twig' %}
{% endblock %}
{% block base_flashbags %}
{% if app.flashes and app.flashes|length > 0 %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block base_body_script %}
{{ parent() }}
<script type="text/javascript">
{% if controllerName|lower == "product" %}
let soluteLandingTrackingTracked = false;
window.addEventListener('CookiebotOnAccept', function (e) {
if (!Cookiebot.consent.marketing) return;
if (soluteLandingTrackingTracked) return;
(function soluteLandingTracking() {
if (location.href.indexOf("soluteclid") < 0) return;
localStorage.setItem("soluteclid", (new Date()).getTime() + " " + location.href);
var url = "https://cmodul.solutenetwork.com/landing";
url += "?url=" + encodeURIComponent(location.href);
var req = new XMLHttpRequest();
req.open("GET", url);
req.send();
})();
soluteLandingTrackingTracked = true;
}, false);
{% endif %}
{% if controllerName|lower == "checkout" and controllerAction|lower == "finishpage" %}
{% if page.cart %}
{% set summary = page.cart %}
{% elseif page.order %}
{% set summary = page.order %}
{% endif %}
{% if summary.price.taxStatus != "gross" %}
{% set positionsNet = summary.price.positionPrice %}
{% else %}
{% set positionsNet = 0 %}
{% for lineItem in summary.lineItems %}
{% for calculatedTax in lineItem.price.calculatedTaxes %}
{% set positionsNet = positionsNet + (calculatedTax.price - calculatedTax.tax) %}
{% endfor %}
{% endfor %}
{% endif %}
function soluteConversionTracking(data) {
var ttl = 1000 * 60 * 60 * 24 * 30;
var a = localStorage.getItem("soluteclid");
if (!a) return;
var b = a.split(" ", 2);
if (parseInt(b[0]) + ttl > (new Date()).getTime()) {
var url = "https://cmodul.solutenetwork.com/conversion";
url += "?val=" + encodeURIComponent(data.VALUE);
url += "&oid=" + encodeURIComponent(data.ORDER_ID);
url += "&factor=" + encodeURIComponent(data.FACTOR);
url += "&url=" + encodeURIComponent(b[1]);
var req = new XMLHttpRequest();
req.open("GET", url);
req.send();
} else {
localStorage.removeItem("soluteclid");
}
}
let soluteConversionTrackingTracked = false;
window.addEventListener('CookiebotOnAccept', function (e) {
if (!Cookiebot.consent.marketing) return;
if (soluteConversionTrackingTracked) return;
soluteConversionTracking({
VALUE: "{{ positionsNet }}",
ORDER_ID: "{{ page.order.orderNumber }}",
FACTOR: "1",
});
soluteConversionTrackingTracked = true;
}, false);
{% endif %}
</script>
{% endblock %}