var/cache/dev/twig/7b/7b09c0f3de265f970726ace8993e31e3.php line 45

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* product/product_teaser.html.twig */
  14. class __TwigTemplate_1f4b34abc009e3027ec8ccd10ba4f34e extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $this->checkSecurity();
  27.     }
  28.     protected function doDisplay(array $context, array $blocks = [])
  29.     {
  30.         $macros $this->macros;
  31.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  32.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""product/product_teaser.html.twig"));
  33.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  34.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""product/product_teaser.html.twig"));
  35.         // line 1
  36.         $context["detailLink"] = $this->extensions['App\Twig\Extension\ProductPageExtension']->generateLink($this->sandbox->ensureToStringAllowed((isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'1$this->source); })()), 1$this->source));
  37.         // line 2
  38.         echo "
  39. <a href=\"";
  40.         // line 3
  41.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["detailLink"]) || array_key_exists("detailLink"$context) ? $context["detailLink"] : (function () { throw new RuntimeError('Variable "detailLink" does not exist.'3$this->source); })()), 3$this->source), "html"nulltrue);
  42.         echo "\" class=\"relative flex flex-col overflow-hidden bg-gray-100 hover:shadow-xl-center rounded-lg transition ease duration-300\">
  43.     <div class=\"w-full overflow-hidden lg:h-50 px-3 pt-3\">
  44.         ";
  45.         // line 5
  46.         echo (( !twig_test_empty(twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'5$this->source); })()), "mainImage", [], "any"falsefalsetrue5))) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'5$this->source); })()), "mainImage", [], "any"falsefalsetrue5), "thumbnail", [=> "productThumbnail"], "method"falsefalsetrue5), "html", [], "any"falsefalsetrue5)) : (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcePimcore\Model\Asset::getByPath("/System/missing.png"), "thumbnail", [=> "productThumbnail"], "method"falsefalsetrue5), "html", [], "any"falsefalsetrue5)));
  47.         echo " ";
  48.         // line 6
  49.         echo "    </div>
  50.     ";
  51.         // line 7
  52.         if (( !twig_test_empty(twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'7$this->source); })()), "specialities", [], "any"falsefalsetrue7)) && twig_in_filter("Special Deal"twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'7$this->source); })()), "specialities", [], "any"falsefalsetrue7)))) {
  53.             // line 8
  54.             echo "        <span class=\"absolute top-2 right-2 bg-red-600 text-center text-white text-xs rounded-full px-2 py-1\">Special Deal %</span>
  55.     ";
  56.         } elseif (twig_get_attribute($this->env$this->source,         // line 9
  57. (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'9$this->source); })()), "discontinued", [], "any"falsefalsetrue9)) {
  58.             // line 10
  59.             echo "    <span class=\"absolute top-2 right-2 bg-brand-600 text-center text-white text-xs rounded-full px-2 py-1\">Auslaufartikel</span>
  60.     ";
  61.         }
  62.         // line 12
  63.         echo "    ";
  64.         if (twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'12$this->source); })()), "productGroup", [], "any"falsefalsetrue12)) {
  65.             // line 13
  66.             echo "        <div class=\"flex\" style=\"max-width: 9rem\">
  67.             <span class=\"text-white text-sm rounded-r-full pl-4 pr-8 py-1 w-fit mt-4\" style=\"background-color: ";
  68.             // line 14
  69.             echo twig_escape_filter($this->envtwig_slice($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'14$this->source); })()), "productGroup", [], "any"falsefalsetrue14), "color", [], "any"falsefalsetrue14), 14$this->source), 07), "html"nulltrue);
  70.             echo ";\">";
  71.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'14$this->source); })()), "productGroup", [], "any"falsefalsetrue14), "name", [], "any"falsefalsetrue14), 14$this->source), "html"nulltrue);
  72.             echo "</span>
  73.         </div>
  74.     ";
  75.         }
  76.         // line 17
  77.         echo "    <div class=\"p-4 flex flex-1 flex-col space-y-2\">
  78.         <h3 class=\"text-md text-gray-900 leading-tight\">
  79.             ";
  80.         // line 19
  81.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'19$this->source); })()), "name", [], "any"falsefalsetrue19), 19$this->source), "html"nulltrue);
  82.         echo "
  83.         </h3>
  84.         <div class=\"flex flex-1 flex-col justify-end\">
  85.             <p class=\"text-sm text-gray-500\">";
  86.         // line 22
  87.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'22$this->source); })()), "code", [], "any"falsefalsetrue22), 22$this->source), "html"nulltrue);
  88.         echo "</p>
  89.         </div>
  90.     </div>
  91. </a>";
  92.         
  93.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  94.         
  95.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  96.     }
  97.     public function getTemplateName()
  98.     {
  99.         return "product/product_teaser.html.twig";
  100.     }
  101.     public function isTraitable()
  102.     {
  103.         return false;
  104.     }
  105.     public function getDebugInfo()
  106.     {
  107.         return array (  96 => 22,  90 => 19,  86 => 17,  78 => 14,  75 => 13,  72 => 12,  68 => 10,  66 => 9,  63 => 8,  61 => 7,  58 => 6,  55 => 5,  50 => 3,  47 => 2,  45 => 1,);
  108.     }
  109.     public function getSourceContext()
  110.     {
  111.         return new Source("{% set detailLink = app_product_detaillink(product) %}
  112. <a href=\"{{ detailLink }}\" class=\"relative flex flex-col overflow-hidden bg-gray-100 hover:shadow-xl-center rounded-lg transition ease duration-300\">
  113.     <div class=\"w-full overflow-hidden lg:h-50 px-3 pt-3\">
  114.         {{ (product.mainImage is not empty ? product.mainImage.thumbnail('productThumbnail').html : pimcore_asset_by_path('/System/missing.png').thumbnail('productThumbnail').html ) | raw }} {# class=\"w-full h-full object-center object-cover sm:w-full sm:h-full\" #}
  115.     </div>
  116.     {% if product.specialities is not empty and \"Special Deal\" in product.specialities %}
  117.         <span class=\"absolute top-2 right-2 bg-red-600 text-center text-white text-xs rounded-full px-2 py-1\">Special Deal %</span>
  118.     {% elseif product.discontinued %}
  119.     <span class=\"absolute top-2 right-2 bg-brand-600 text-center text-white text-xs rounded-full px-2 py-1\">Auslaufartikel</span>
  120.     {% endif %}
  121.     {% if product.productGroup %}
  122.         <div class=\"flex\" style=\"max-width: 9rem\">
  123.             <span class=\"text-white text-sm rounded-r-full pl-4 pr-8 py-1 w-fit mt-4\" style=\"background-color: {{ product.productGroup.color | slice(0,7) }};\">{{ product.productGroup.name }}</span>
  124.         </div>
  125.     {% endif %}
  126.     <div class=\"p-4 flex flex-1 flex-col space-y-2\">
  127.         <h3 class=\"text-md text-gray-900 leading-tight\">
  128.             {{ product.name }}
  129.         </h3>
  130.         <div class=\"flex flex-1 flex-col justify-end\">
  131.             <p class=\"text-sm text-gray-500\">{{ product.code }}</p>
  132.         </div>
  133.     </div>
  134. </a>""product/product_teaser.html.twig""/var/www/html/templates/product/product_teaser.html.twig");
  135.     }
  136.     
  137.     public function checkSecurity()
  138.     {
  139.         static $tags = array("set" => 1"if" => 7);
  140.         static $filters = array("escape" => 3"raw" => 5"slice" => 14);
  141.         static $functions = array("app_product_detaillink" => 1"pimcore_asset_by_path" => 5);
  142.         try {
  143.             $this->sandbox->checkSecurity(
  144.                 ['set''if'],
  145.                 ['escape''raw''slice'],
  146.                 ['app_product_detaillink''pimcore_asset_by_path']
  147.             );
  148.         } catch (SecurityError $e) {
  149.             $e->setSourceContext($this->source);
  150.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  151.                 $e->setTemplateLine($tags[$e->getTagName()]);
  152.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  153.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  154.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  155.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  156.             }
  157.             throw $e;
  158.         }
  159.     }
  160. }