<?php
use Twig\Environment;
use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* @econdWebAnalytics/storefront/page/product-detail/index.html.twig */
class __TwigTemplate_d0898866353b9388c56f3a2fc3747c95 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'econda_header_content' => [$this, 'block_econda_header_content'],
];
}
protected function doGetParent(array $context)
{
// line 2
return "@Storefront/storefront/page/product-detail/index.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@econdWebAnalytics/storefront/page/product-detail/index.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@econdWebAnalytics/storefront/page/product-detail/index.html.twig"));
$this->parent = $this->loadTemplate("@Storefront/storefront/page/product-detail/index.html.twig", "@econdWebAnalytics/storefront/page/product-detail/index.html.twig", 2);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_econda_header_content($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "econda_header_content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "econda_header_content"));
// line 4
echo " function getQuantityPrice(quantity) {
";
// line 6
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 6), "getCalculatedPrices", [], "method", false, false, false, 6), "elements", [], "any", false, false, false, 6));
foreach ($context['_seq'] as $context["_key"] => $context["element"]) {
// line 7
echo "
if (quantity <= ";
// line 8
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, $context["element"], "getQuantity", [], "method", false, false, false, 8), "html", null, true);
echo ") {
return '";
// line 9
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, $context["element"], "getUnitPrice", [], "method", false, false, false, 9), "html", null, true);
echo "';
}
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['element'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 13
echo "
return ";
// line 14
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, twig_last($this->env, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 14), "getCalculatedPrices", [], "method", false, false, false, 14), "elements", [], "any", false, false, false, 14)), "getUnitPrice", [], "method", false, false, false, 14), "html", null, true);
echo "
}
function ecViewFunction(event) {
var allBasketActions = [];
var basketAction = { };
basketAction.type = event;
basketAction.count = '1';
if(event == 'view') {
";
// line 28
if ( !twig_test_empty(sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 28), "getCalculatedPrices", [], "method", false, false, false, 28), "elements", [], "any", false, false, false, 28))) {
// line 29
echo " basketAction.price = '";
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_0 = sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 29), "getCalculatedPrices", [], "method", false, false, false, 29), "elements", [], "any", false, false, false, 29)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[0] ?? null) : null), "unitPrice", [], "any", false, false, false, 29), "html", null, true);
echo "';
";
} else {
// line 31
echo " basketAction.price = '";
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 31), "getCalculatedPrice", [], "method", false, false, false, 31), "getUnitPrice", [], "method", false, false, false, 31), "html", null, true);
echo "';
";
}
// line 33
echo " }
if(event == 'c_add') {
if (jQuery(\"select.custom-select.product-detail-quantity-select\").val() != 1) {
basketAction.count = jQuery(\"select.custom-select.product-detail-quantity-select\").val();
}
";
// line 40
if ( !twig_test_empty(sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 40), "getCalculatedPrices", [], "method", false, false, false, 40), "elements", [], "any", false, false, false, 40))) {
// line 41
echo " basketAction.price = getQuantityPrice(basketAction.count);
";
} else {
// line 43
echo " basketAction.price = '";
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 43), "getCalculatedPrice", [], "method", false, false, false, 43), "getUnitPrice", [], "method", false, false, false, 43), "html", null, true);
echo "';
";
}
// line 45
echo " }
basketAction.pid = '";
// line 47
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_1 = sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "extensions", [], "any", false, false, false, 47)) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1["ANA"] ?? null) : null), "get", [0 => "pid"], "method", false, false, false, 47), "html", null, true);
echo "';
basketAction.sku = '";
// line 48
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "getProduct", [], "method", false, false, false, 48), "getProductNumber", [], "method", false, false, false, 48), "html", null, true);
echo "';
basketAction.name = '";
// line 49
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "product", [], "any", false, false, false, 49), "translated", [], "any", false, false, false, 49), "name", [], "any", false, false, false, 49), "html", null, true);
echo "';
basketAction.group = '";
// line 50
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_2 = sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "extensions", [], "any", false, false, false, 50)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2["ANA"] ?? null) : null), "get", [0 => "group"], "method", false, false, false, 50), "html", null, true);
echo "';
basketAction.var1 = '";
// line 51
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_3 = sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "extensions", [], "any", false, false, false, 51)) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3["ANA"] ?? null) : null), "get", [0 => "var1"], "method", false, false, false, 51), "html", null, true);
echo "';
basketAction.var2 = '";
// line 52
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_4 = sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "extensions", [], "any", false, false, false, 52)) && is_array($__internal_compile_4) || $__internal_compile_4 instanceof ArrayAccess ? ($__internal_compile_4["ANA"] ?? null) : null), "get", [0 => "var2"], "method", false, false, false, 52), "html", null, true);
echo "';
basketAction.var3 = '";
// line 53
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, (($__internal_compile_5 = sw_get_attribute($this->env, $this->source, ($context["page"] ?? null), "extensions", [], "any", false, false, false, 53)) && is_array($__internal_compile_5) || $__internal_compile_5 instanceof ArrayAccess ? ($__internal_compile_5["ANA"] ?? null) : null), "get", [0 => "var3"], "method", false, false, false, 53), "html", null, true);
echo "';
allBasketActions.push(basketAction);
emospro.ec_Event = allBasketActions;
}
ecViewFunction('view');
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "@econdWebAnalytics/storefront/page/product-detail/index.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
{% block econda_header_content %}
function getQuantityPrice(quantity) {
{% for element in page.getProduct().getCalculatedPrices().elements %}
if (quantity <= {{ element.getQuantity() }}) {
return '{{ element.getUnitPrice() }}';
}
{% endfor %}
return {{ page.getProduct().getCalculatedPrices().elements|last.getUnitPrice() }}
}
function ecViewFunction(event) {
var allBasketActions = [];
var basketAction = { };
basketAction.type = event;
basketAction.count = '1';
if(event == 'view') {
{% if page.getProduct().getCalculatedPrices().elements is not empty %}
basketAction.price = '{{ page.getProduct().getCalculatedPrices().elements[0].unitPrice }}';
{% else %}
basketAction.price = '{{ page.getProduct().getCalculatedPrice().getUnitPrice() }}';
{% endif %}
}
if(event == 'c_add') {
if (jQuery(\"select.custom-select.product-detail-quantity-select\").val() != 1) {
basketAction.count = jQuery(\"select.custom-select.product-detail-quantity-select\").val();
}
{% if page.getProduct().getCalculatedPrices().elements is not empty %}
basketAction.price = getQuantityPrice(basketAction.count);
{% else %}
basketAction.price = '{{ page.getProduct().getCalculatedPrice().getUnitPrice() }}';
{% endif %}
}
basketAction.pid = '{{ page.extensions['ANA'].get('pid') }}';
basketAction.sku = '{{ page.getProduct().getProductNumber() }}';
basketAction.name = '{{ page.product.translated.name }}';
basketAction.group = '{{ page.extensions['ANA'].get('group') }}';
basketAction.var1 = '{{ page.extensions['ANA'].get('var1') }}';
basketAction.var2 = '{{ page.extensions['ANA'].get('var2') }}';
basketAction.var3 = '{{ page.extensions['ANA'].get('var3') }}';
allBasketActions.push(basketAction);
emospro.ec_Event = allBasketActions;
}
ecViewFunction('view');
{% 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");
}
}