var/cache/dev_h5b02c48344407d68d61eb74a0cdcd8b0/twig/09/09f71b8cbb2975c4bb676239013e937eee6205205c86c21b8225c6c0e0049a1d.php line 51

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
  4. use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
  5. use Twig\Error\LoaderError;
  6. use Twig\Error\RuntimeError;
  7. use Twig\Extension\SandboxExtension;
  8. use Twig\Markup;
  9. use Twig\Sandbox\SecurityError;
  10. use Twig\Sandbox\SecurityNotAllowedTagError;
  11. use Twig\Sandbox\SecurityNotAllowedFilterError;
  12. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  13. use Twig\Source;
  14. use Twig\Template;
  15. /* @ShopsyKlaviyo6/storefront/base.html.twig */
  16. class __TwigTemplate_e9068fe1a435c529e973dbdb128f1af8 extends Template
  17. {
  18.     private $source;
  19.     private $macros = [];
  20.     public function __construct(Environment $env)
  21.     {
  22.         parent::__construct($env);
  23.         $this->source $this->getSourceContext();
  24.         $this->blocks = [
  25.             'base_body_script' => [$this'block_base_body_script'],
  26.             'base_body' => [$this'block_base_body'],
  27.         ];
  28.     }
  29.     protected function doGetParent(array $context)
  30.     {
  31.         // line 2
  32.         return "@IntediaDoofinderSW6/storefront/base.html.twig";
  33.     }
  34.     protected function doDisplay(array $context, array $blocks = [])
  35.     {
  36.         $macros $this->macros;
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  38.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@ShopsyKlaviyo6/storefront/base.html.twig"));
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  40.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@ShopsyKlaviyo6/storefront/base.html.twig"));
  41.         $this->parent $this->loadTemplate("@IntediaDoofinderSW6/storefront/base.html.twig""@ShopsyKlaviyo6/storefront/base.html.twig"2);
  42.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  43.         
  44.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  45.         
  46.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  47.     }
  48.     // line 3
  49.     public function block_base_body_script($context, array $blocks = [])
  50.     {
  51.         $macros $this->macros;
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  53.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""base_body_script"));
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  55.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""base_body_script"));
  56.         // line 4
  57.         echo "    ";
  58.         $this->displayParentBlock("base_body_script"$context$blocks);
  59.         echo "
  60.     <script type=\"text/javascript\">
  61.         document.addEventListener(\"DOMContentLoaded\", function(event) {
  62.             var substring = 'shopsyKlaviyo=shopsyKlaviyo';
  63.             var checkCookie = document.cookie.indexOf(substring) !== -1;
  64.             var cookieRequired;
  65.             if (document.getElementsByName('cookieRequired')[0] !== undefined) {
  66.                 cookieRequired = document.getElementsByName('cookieRequired')[0].value;
  67.             }
  68.             if (cookieRequired !== \"1\" || checkCookie) {
  69.                 waitForKlaviyoElement('form button.needsclick').then((elm) => {
  70.                     const submitbutton = document.querySelectorAll('form button.needsclick');
  71.                     submitbutton[0].addEventListener('click', function () {
  72.                         const email = document.querySelectorAll('form input.needsclick[type=email]')[0].value;
  73.                         window.localStorage.setItem('klaviyoValue', btoa(email));
  74.                     });
  75.                 });
  76.                 var imported = document.createElement('script');
  77.                 imported.src = 'https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=";
  78.         // line 26
  79.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "shopsyKlaviyo", [], "any"falsefalsefalse26), "apiKey", [], "any"falsefalsefalse26), "html"nulltrue);
  80.         echo "';
  81.                 imported.setAttribute(\"type\", \"text/javascript\");
  82.                 imported.async = 'async';
  83.                 document.head.appendChild(imported);
  84.             }
  85.             if (checkCookie || cookieRequired !== \"1\") {
  86.                 !function () {
  87.                     if (!window.klaviyo) {
  88.                         window._klOnsite = window._klOnsite || [];
  89.                         try {
  90.                             window.klaviyo = new Proxy({}, {
  91.                                 get: function (n, i) {
  92.                                     return \"push\" === i ? function () {
  93.                                         var n;
  94.                                         (n = window._klOnsite).push.apply(n, arguments)
  95.                                     } : function () {
  96.                                         for (var n = arguments.length, o = new Array(n), w = 0; w < n; w++)
  97.                                             o[w] = arguments[w];
  98.                                         var t = \"function\" == typeof o[o.length - 1] ? o.pop() : void 0,
  99.                                             e = new Promise(function (n) {
  100.                                                 window._klOnsite.push([i].concat(o, [function (i) {
  101.                                                     t && t(i), n(i)
  102.                                                 }]))
  103.                                             });
  104.                                         return e
  105.                                     }
  106.                                 }
  107.                             })
  108.                         } catch (n) {
  109.                             window.klaviyo = window.klaviyo || [], window.klaviyo.push = function () {
  110.                                 var n;
  111.                                 (n = window._klOnsite).push.apply(n, arguments)
  112.                             }
  113.                         }
  114.                     }
  115.                 }();
  116.                 (function () {
  117.                     var b = document.createElement('script');
  118.                     b.type = 'text/javascript';
  119.                     b.async = true;
  120.                     b.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'static.klaviyo.com/onsite/js/klaviyo.js?company_id=";
  121.         // line 68
  122.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "shopsyKlaviyo", [], "any"falsefalsefalse68), "apiKey", [], "any"falsefalsefalse68), "html"nulltrue);
  123.         echo "';
  124.                     var a = document.getElementsByTagName('script')[0];
  125.                     a.parentNode.insertBefore(b, a);
  126.                 })();
  127.             }
  128.         });
  129.         function waitForKlaviyoElement(selector) {
  130.             return new Promise(resolve => {
  131.                 if (document.querySelector(selector)) {
  132.                     return resolve(document.querySelector(selector));
  133.                 }
  134.                 const observer = new MutationObserver(mutations => {
  135.                     if (document.querySelector(selector)) {
  136.                         resolve(document.querySelector(selector));
  137.                         observer.disconnect();
  138.                     }
  139.                 });
  140.                 observer.observe(document.body, {
  141.                     childList: true,
  142.                     subtree: true
  143.                 });
  144.             });
  145.         }
  146.     </script>
  147. ";
  148.         
  149.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  150.         
  151.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  152.     }
  153.     // line 98
  154.     public function block_base_body($context, array $blocks = [])
  155.     {
  156.         $macros $this->macros;
  157.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  158.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""base_body"));
  159.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  160.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""base_body"));
  161.         // line 99
  162.         echo "    ";
  163.         $this->displayParentBlock("base_body"$context$blocks);
  164.         echo "
  165.     ";
  166.         // line 101
  167.         $this->loadTemplate("@ShopsyKlaviyo6/storefront/shopsy-klaviyo/shopsy-klaviyo-hidden-input-fields.html.twig""@ShopsyKlaviyo6/storefront/base.html.twig"101)->display($context);
  168.         
  169.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  170.         
  171.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  172.     }
  173.     public function getTemplateName()
  174.     {
  175.         return "@ShopsyKlaviyo6/storefront/base.html.twig";
  176.     }
  177.     public function isTraitable()
  178.     {
  179.         return false;
  180.     }
  181.     public function getDebugInfo()
  182.     {
  183.         return array (  195 => 101,  189 => 99,  179 => 98,  140 => 68,  95 => 26,  69 => 4,  59 => 3,  36 => 2,);
  184.     }
  185.     public function getSourceContext()
  186.     {
  187.         return new Source("{% sw_extends '@Storefront/storefront/base.html.twig' %}
  188. {% block base_body_script %}
  189.     {{ parent() }}
  190.     <script type=\"text/javascript\">
  191.         document.addEventListener(\"DOMContentLoaded\", function(event) {
  192.             var substring = 'shopsyKlaviyo=shopsyKlaviyo';
  193.             var checkCookie = document.cookie.indexOf(substring) !== -1;
  194.             var cookieRequired;
  195.             if (document.getElementsByName('cookieRequired')[0] !== undefined) {
  196.                 cookieRequired = document.getElementsByName('cookieRequired')[0].value;
  197.             }
  198.             if (cookieRequired !== \"1\" || checkCookie) {
  199.                 waitForKlaviyoElement('form button.needsclick').then((elm) => {
  200.                     const submitbutton = document.querySelectorAll('form button.needsclick');
  201.                     submitbutton[0].addEventListener('click', function () {
  202.                         const email = document.querySelectorAll('form input.needsclick[type=email]')[0].value;
  203.                         window.localStorage.setItem('klaviyoValue', btoa(email));
  204.                     });
  205.                 });
  206.                 var imported = document.createElement('script');
  207.                 imported.src = 'https://static.klaviyo.com/onsite/js/klaviyo.js?company_id={{ page.shopsyKlaviyo.apiKey }}';
  208.                 imported.setAttribute(\"type\", \"text/javascript\");
  209.                 imported.async = 'async';
  210.                 document.head.appendChild(imported);
  211.             }
  212.             if (checkCookie || cookieRequired !== \"1\") {
  213.                 !function () {
  214.                     if (!window.klaviyo) {
  215.                         window._klOnsite = window._klOnsite || [];
  216.                         try {
  217.                             window.klaviyo = new Proxy({}, {
  218.                                 get: function (n, i) {
  219.                                     return \"push\" === i ? function () {
  220.                                         var n;
  221.                                         (n = window._klOnsite).push.apply(n, arguments)
  222.                                     } : function () {
  223.                                         for (var n = arguments.length, o = new Array(n), w = 0; w < n; w++)
  224.                                             o[w] = arguments[w];
  225.                                         var t = \"function\" == typeof o[o.length - 1] ? o.pop() : void 0,
  226.                                             e = new Promise(function (n) {
  227.                                                 window._klOnsite.push([i].concat(o, [function (i) {
  228.                                                     t && t(i), n(i)
  229.                                                 }]))
  230.                                             });
  231.                                         return e
  232.                                     }
  233.                                 }
  234.                             })
  235.                         } catch (n) {
  236.                             window.klaviyo = window.klaviyo || [], window.klaviyo.push = function () {
  237.                                 var n;
  238.                                 (n = window._klOnsite).push.apply(n, arguments)
  239.                             }
  240.                         }
  241.                     }
  242.                 }();
  243.                 (function () {
  244.                     var b = document.createElement('script');
  245.                     b.type = 'text/javascript';
  246.                     b.async = true;
  247.                     b.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'static.klaviyo.com/onsite/js/klaviyo.js?company_id={{ page.shopsyKlaviyo.apiKey }}';
  248.                     var a = document.getElementsByTagName('script')[0];
  249.                     a.parentNode.insertBefore(b, a);
  250.                 })();
  251.             }
  252.         });
  253.         function waitForKlaviyoElement(selector) {
  254.             return new Promise(resolve => {
  255.                 if (document.querySelector(selector)) {
  256.                     return resolve(document.querySelector(selector));
  257.                 }
  258.                 const observer = new MutationObserver(mutations => {
  259.                     if (document.querySelector(selector)) {
  260.                         resolve(document.querySelector(selector));
  261.                         observer.disconnect();
  262.                     }
  263.                 });
  264.                 observer.observe(document.body, {
  265.                     childList: true,
  266.                     subtree: true
  267.                 });
  268.             });
  269.         }
  270.     </script>
  271. {% endblock %}
  272. {% block base_body %}
  273.     {{ parent() }}
  274.     {% sw_include '@ShopsyKlaviyo6/storefront/shopsy-klaviyo/shopsy-klaviyo-hidden-input-fields.html.twig' %}
  275. {% endblock %}""@ShopsyKlaviyo6/storefront/base.html.twig""/var/www/staging1.grimm-gastrobedarf.de/custom/plugins/ShopsyKlaviyo6/src/Resources/views/storefront/base.html.twig");
  276.     }
  277. }