custom/plugins/WbfkThemeMMedientechnik/src/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_header_inner %}
  3.     {% sw_include '@WbfkThemeMMedientechnik/storefront/component/pre-header.html.twig' %}
  4.     {{ parent() }}
  5. {% endblock %}
  6. {% block base_main %}
  7.     {% sw_include '@WbfkThemeMMedientechnik/storefront/component/floating-chat-telefon.twig' %}
  8.     {% sw_include '@WbfkThemeMMedientechnik/storefront/component/change-language-modal.html.twig' %}
  9.     {{ parent() }}
  10. {% endblock %}
  11. {% block base_footer %}
  12.     {{ parent() }}
  13.     {% sw_include '@WbfkThemeMMedientechnik/storefront/component/footer.twig' %}
  14. {% endblock %}
  15. {% block base_flashbags %}
  16.     {% if app.flashes and app.flashes|length > 0 %}
  17.         {{ parent() }}
  18.     {% endif %}
  19. {% endblock %}
  20. {% block base_body_script %}
  21.     {{ parent() }}
  22.     <script type="text/javascript">
  23.         {% if controllerName|lower == "product" %}
  24.         let soluteLandingTrackingTracked = false;
  25.         window.addEventListener('CookiebotOnAccept', function (e) {
  26.             if (!Cookiebot.consent.marketing) return;
  27.             if (soluteLandingTrackingTracked) return;
  28.             (function soluteLandingTracking() {
  29.                 if (location.href.indexOf("soluteclid") < 0) return;
  30.                 localStorage.setItem("soluteclid", (new Date()).getTime() + " " + location.href);
  31.                 var url = "https://cmodul.solutenetwork.com/landing";
  32.                 url += "?url=" + encodeURIComponent(location.href);
  33.                 var req = new XMLHttpRequest();
  34.                 req.open("GET", url);
  35.                 req.send();
  36.             })();
  37.             soluteLandingTrackingTracked = true;
  38.         }, false);
  39.         {% endif %}
  40.         {% if controllerName|lower == "checkout" and controllerAction|lower == "finishpage" %}
  41.         {% if page.cart %}
  42.         {% set summary = page.cart %}
  43.         {% elseif page.order %}
  44.         {% set summary = page.order %}
  45.         {% endif %}
  46.         {% if summary.price.taxStatus != "gross" %}
  47.         {% set positionsNet = summary.price.positionPrice %}
  48.         {% else %}
  49.         {% set positionsNet = 0 %}
  50.         {% for lineItem in summary.lineItems %}
  51.         {% for calculatedTax in lineItem.price.calculatedTaxes %}
  52.         {% set positionsNet = positionsNet + (calculatedTax.price - calculatedTax.tax) %}
  53.         {% endfor %}
  54.         {% endfor %}
  55.         {% endif %}
  56.         function soluteConversionTracking(data) {
  57.             var ttl = 1000 * 60 * 60 * 24 * 30;
  58.             var a = localStorage.getItem("soluteclid");
  59.             if (!a) return;
  60.             var b = a.split(" ", 2);
  61.             if (parseInt(b[0]) + ttl > (new Date()).getTime()) {
  62.                 var url = "https://cmodul.solutenetwork.com/conversion";
  63.                 url += "?val=" + encodeURIComponent(data.VALUE);
  64.                 url += "&oid=" + encodeURIComponent(data.ORDER_ID);
  65.                 url += "&factor=" + encodeURIComponent(data.FACTOR);
  66.                 url += "&url=" + encodeURIComponent(b[1]);
  67.                 var req = new XMLHttpRequest();
  68.                 req.open("GET", url);
  69.                 req.send();
  70.             } else {
  71.                 localStorage.removeItem("soluteclid");
  72.             }
  73.         }
  74.         let soluteConversionTrackingTracked = false;
  75.         window.addEventListener('CookiebotOnAccept', function (e) {
  76.             if (!Cookiebot.consent.marketing) return;
  77.             if (soluteConversionTrackingTracked) return;
  78.             soluteConversionTracking({
  79.                 VALUE: "{{ positionsNet }}",
  80.                 ORDER_ID: "{{ page.order.orderNumber }}",
  81.                 FACTOR: "1",
  82.             });
  83.             soluteConversionTrackingTracked = true;
  84.         }, false);
  85.         {% endif %}
  86.     </script>
  87. {% endblock %}