var/cache/dev_h00fd8923ecf393ec0b25403e00167bec/twig/e5/e52388549ce96261b3f96a3f1d037ace9d8b0875c8a8de0af44277455a592782.php line 50

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. /* @econdWebAnalytics/storefront/page/product-detail/index.html.twig */
  16. class __TwigTemplate_d0898866353b9388c56f3a2fc3747c95 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.             'econda_header_content' => [$this'block_econda_header_content'],
  26.         ];
  27.     }
  28.     protected function doGetParent(array $context)
  29.     {
  30.         // line 2
  31.         return "@Storefront/storefront/page/product-detail/index.html.twig";
  32.     }
  33.     protected function doDisplay(array $context, array $blocks = [])
  34.     {
  35.         $macros $this->macros;
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@econdWebAnalytics/storefront/page/product-detail/index.html.twig"));
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@econdWebAnalytics/storefront/page/product-detail/index.html.twig"));
  40.         $this->parent $this->loadTemplate("@Storefront/storefront/page/product-detail/index.html.twig""@econdWebAnalytics/storefront/page/product-detail/index.html.twig"2);
  41.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  42.         
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  44.         
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  46.     }
  47.     // line 3
  48.     public function block_econda_header_content($context, array $blocks = [])
  49.     {
  50.         $macros $this->macros;
  51.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""econda_header_content"));
  53.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""econda_header_content"));
  55.         // line 4
  56.         echo "    function getQuantityPrice(quantity) {
  57.         ";
  58.         // line 6
  59.         $context['_parent'] = $context;
  60.         $context['_seq'] = twig_ensure_traversable(sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse6), "getCalculatedPrices", [], "method"falsefalsefalse6), "elements", [], "any"falsefalsefalse6));
  61.         foreach ($context['_seq'] as $context["_key"] => $context["element"]) {
  62.             // line 7
  63.             echo "
  64.             if (quantity <= ";
  65.             // line 8
  66.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source$context["element"], "getQuantity", [], "method"falsefalsefalse8), "html"nulltrue);
  67.             echo ") {
  68.                 return '";
  69.             // line 9
  70.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source$context["element"], "getUnitPrice", [], "method"falsefalsefalse9), "html"nulltrue);
  71.             echo "';
  72.             }
  73.         ";
  74.         }
  75.         $_parent $context['_parent'];
  76.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['element'], $context['_parent'], $context['loop']);
  77.         $context array_intersect_key($context$_parent) + $_parent;
  78.         // line 13
  79.         echo "
  80.         return ";
  81.         // line 14
  82.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcetwig_last($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse14), "getCalculatedPrices", [], "method"falsefalsefalse14), "elements", [], "any"falsefalsefalse14)), "getUnitPrice", [], "method"falsefalsefalse14), "html"nulltrue);
  83.         echo "
  84.     }
  85.     function ecViewFunction(event) {
  86.         var allBasketActions = [];
  87.         var basketAction = { };
  88.         basketAction.type = event;
  89.         basketAction.count = '1';
  90.         if(event == 'view') {
  91.             ";
  92.         // line 28
  93.         if ( !twig_test_empty(sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse28), "getCalculatedPrices", [], "method"falsefalsefalse28), "elements", [], "any"falsefalsefalse28))) {
  94.             // line 29
  95.             echo "                basketAction.price = '";
  96.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_0 sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse29), "getCalculatedPrices", [], "method"falsefalsefalse29), "elements", [], "any"falsefalsefalse29)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[0] ?? null) : null), "unitPrice", [], "any"falsefalsefalse29), "html"nulltrue);
  97.             echo "';
  98.             ";
  99.         } else {
  100.             // line 31
  101.             echo "                basketAction.price = '";
  102.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse31), "getCalculatedPrice", [], "method"falsefalsefalse31), "getUnitPrice", [], "method"falsefalsefalse31), "html"nulltrue);
  103.             echo "';
  104.             ";
  105.         }
  106.         // line 33
  107.         echo "        }
  108.         if(event == 'c_add') {
  109.             if (jQuery(\"select.custom-select.product-detail-quantity-select\").val() != 1) {
  110.                 basketAction.count = jQuery(\"select.custom-select.product-detail-quantity-select\").val();
  111.             }
  112.             ";
  113.         // line 40
  114.         if ( !twig_test_empty(sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse40), "getCalculatedPrices", [], "method"falsefalsefalse40), "elements", [], "any"falsefalsefalse40))) {
  115.             // line 41
  116.             echo "                basketAction.price = getQuantityPrice(basketAction.count);
  117.             ";
  118.         } else {
  119.             // line 43
  120.             echo "                basketAction.price = '";
  121.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse43), "getCalculatedPrice", [], "method"falsefalsefalse43), "getUnitPrice", [], "method"falsefalsefalse43), "html"nulltrue);
  122.             echo "';
  123.             ";
  124.         }
  125.         // line 45
  126.         echo "        }
  127.         basketAction.pid = '";
  128.         // line 47
  129.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_1 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse47)) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1["ANA"] ?? null) : null), "get", [=> "pid"], "method"falsefalsefalse47), "html"nulltrue);
  130.         echo "';
  131.         basketAction.sku = '";
  132.         // line 48
  133.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "getProduct", [], "method"falsefalsefalse48), "getProductNumber", [], "method"falsefalsefalse48), "html"nulltrue);
  134.         echo "';
  135.         basketAction.name = '";
  136.         // line 49
  137.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse49), "translated", [], "any"falsefalsefalse49), "name", [], "any"falsefalsefalse49), "html"nulltrue);
  138.         echo "';
  139.         basketAction.group = '";
  140.         // line 50
  141.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_2 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse50)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2["ANA"] ?? null) : null), "get", [=> "group"], "method"falsefalsefalse50), "html"nulltrue);
  142.         echo "';
  143.         basketAction.var1 = '";
  144.         // line 51
  145.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_3 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse51)) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3["ANA"] ?? null) : null), "get", [=> "var1"], "method"falsefalsefalse51), "html"nulltrue);
  146.         echo "';
  147.         basketAction.var2 = '";
  148.         // line 52
  149.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_4 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse52)) && is_array($__internal_compile_4) || $__internal_compile_4 instanceof ArrayAccess ? ($__internal_compile_4["ANA"] ?? null) : null), "get", [=> "var2"], "method"falsefalsefalse52), "html"nulltrue);
  150.         echo "';
  151.         basketAction.var3 = '";
  152.         // line 53
  153.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, (($__internal_compile_5 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse53)) && is_array($__internal_compile_5) || $__internal_compile_5 instanceof ArrayAccess ? ($__internal_compile_5["ANA"] ?? null) : null), "get", [=> "var3"], "method"falsefalsefalse53), "html"nulltrue);
  154.         echo "';
  155.         allBasketActions.push(basketAction);
  156.         emospro.ec_Event = allBasketActions;
  157.     }
  158.     ecViewFunction('view');
  159. ";
  160.         
  161.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  162.         
  163.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  164.     }
  165.     public function getTemplateName()
  166.     {
  167.         return "@econdWebAnalytics/storefront/page/product-detail/index.html.twig";
  168.     }
  169.     public function isTraitable()
  170.     {
  171.         return false;
  172.     }
  173.     public function getDebugInfo()
  174.     {
  175.         return array (  176 => 53,  172 => 52,  168 => 51,  164 => 50,  160 => 49,  156 => 48,  152 => 47,  148 => 45,  142 => 43,  138 => 41,  136 => 40,  127 => 33,  121 => 31,  115 => 29,  113 => 28,  96 => 14,  93 => 13,  83 => 9,  79 => 8,  76 => 7,  72 => 6,  68 => 4,  58 => 3,  35 => 2,);
  176.     }
  177.     public function getSourceContext()
  178.     {
  179.         return new Source("{% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
  180. {% block econda_header_content %}
  181.     function getQuantityPrice(quantity) {
  182.         {% for element in page.getProduct().getCalculatedPrices().elements %}
  183.             if (quantity <= {{ element.getQuantity() }}) {
  184.                 return '{{ element.getUnitPrice() }}';
  185.             }
  186.         {% endfor %}
  187.         return {{ page.getProduct().getCalculatedPrices().elements|last.getUnitPrice() }}
  188.     }
  189.     function ecViewFunction(event) {
  190.         var allBasketActions = [];
  191.         var basketAction = { };
  192.         basketAction.type = event;
  193.         basketAction.count = '1';
  194.         if(event == 'view') {
  195.             {% if page.getProduct().getCalculatedPrices().elements is not empty %}
  196.                 basketAction.price = '{{ page.getProduct().getCalculatedPrices().elements[0].unitPrice }}';
  197.             {% else %}
  198.                 basketAction.price = '{{ page.getProduct().getCalculatedPrice().getUnitPrice() }}';
  199.             {% endif %}
  200.         }
  201.         if(event == 'c_add') {
  202.             if (jQuery(\"select.custom-select.product-detail-quantity-select\").val() != 1) {
  203.                 basketAction.count = jQuery(\"select.custom-select.product-detail-quantity-select\").val();
  204.             }
  205.             {% if page.getProduct().getCalculatedPrices().elements is not empty %}
  206.                 basketAction.price = getQuantityPrice(basketAction.count);
  207.             {% else %}
  208.                 basketAction.price = '{{ page.getProduct().getCalculatedPrice().getUnitPrice() }}';
  209.             {% endif %}
  210.         }
  211.         basketAction.pid = '{{ page.extensions['ANA'].get('pid') }}';
  212.         basketAction.sku = '{{ page.getProduct().getProductNumber() }}';
  213.         basketAction.name = '{{ page.product.translated.name }}';
  214.         basketAction.group = '{{ page.extensions['ANA'].get('group') }}';
  215.         basketAction.var1 = '{{ page.extensions['ANA'].get('var1') }}';
  216.         basketAction.var2 = '{{ page.extensions['ANA'].get('var2') }}';
  217.         basketAction.var3 = '{{ page.extensions['ANA'].get('var3') }}';
  218.         allBasketActions.push(basketAction);
  219.         emospro.ec_Event = allBasketActions;
  220.     }
  221.     ecViewFunction('view');
  222. {% endblock %}""@econdWebAnalytics/storefront/page/product-detail/index.html.twig""/var/www/shopware6/custom/plugins/econdWebAnalytics/src/Resources/views/storefront/page/product-detail/index.html.twig");
  223.     }
  224. }