var/cache/dev/twig/c3/c304856dc04ccace52d9c38193134597.php line 62

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_50f72ff0bc960adbbced90e64b369a1c 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.         echo "<div class=\"card custom-product-card mb-4 shadow-sm flex-fill\" data-productid=\"";
  37.         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.'1$this->source); })()), "id", [], "any"falsefalsetrue1), 1$this->source), "html"nulltrue);
  38.         echo "\">
  39.     ";
  40.         // line 2
  41.         $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.'2$this->source); })()), 2$this->source));
  42.         // line 3
  43.         echo "    <a href=\"";
  44.         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);
  45.         echo "\" class=\"text-decoration-none text-dark\">
  46.         ";
  47.         // line 4
  48.         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.'4$this->source); })()), "mainImage", [], "any"falsefalsetrue4)) {
  49.             // line 5
  50.             echo "        <div class=\"product-img\">
  51.             ";
  52.             // line 6
  53.             echo $this->sandbox->ensureToStringAllowed(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.'6$this->source); })()), "mainImage", [], "any"falsefalsetrue6), "thumbnail", ["grid"], "method"falsefalsetrue6), "html", [["imgAttributes" => ["class" => "img-fluid w-100"]]], "method"falsefalsetrue6), 6$this->source);
  54.             echo "
  55.         </div>
  56.         ";
  57.         }
  58.         // line 9
  59.         echo "
  60.         <div class=\"card-body pricing\">
  61.             <div class=\"card-body-top pb-3\">
  62.                 <h4 class=\"card-title pricing-card-title text-uppercase\">";
  63.         // line 13
  64.         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.'13$this->source); })()), "oSName", [], "any"falsefalsetrue13), 13$this->source), "html"nulltrue);
  65.         echo "</h4>
  66.                 ";
  67.         // line 14
  68.         if ($this->env->getTest('instanceof')->getCallable()((isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'14$this->source); })()), "App\\Model\\Product\\Car")) {
  69.             // line 15
  70.             echo "                    <p class=\"card-text\">";
  71.             echo $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.'15$this->source); })()), "subText", [], "any"falsefalsetrue15), 15$this->source);
  72.             echo "</p>
  73.                 ";
  74.         } elseif (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,         // line 16
  75. (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'16$this->source); })()), "saleInformation", [], "any"falsefalsetrue16), "saleInformation", [], "any"falsefalsetrue16)) {
  76.             // line 17
  77.             echo "                    <p class=\"card-text\">";
  78.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.condition"), "html"nulltrue);
  79.             echo ": ";
  80.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("attribute." $this->sandbox->ensureToStringAllowed(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.'17$this->source); })()), "saleInformation", [], "any"falsefalsetrue17), "saleInformation", [], "any"falsefalsetrue17), "condition", [], "any"falsefalsetrue17), 17$this->source))), "html"nulltrue);
  81.             echo "</p>
  82.                 ";
  83.         }
  84.         // line 19
  85.         echo "            </div>
  86.             <div class=\"card-body-bottom\">
  87.                 ";
  88.         // line 22
  89.         $context["priceInfo"] = 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); })()), "oSPriceInfo", [], "any"falsefalsetrue22);
  90.         // line 23
  91.         echo "
  92.                 ";
  93.         // line 24
  94.         if (twig_get_attribute($this->env$this->source, (isset($context["priceInfo"]) || array_key_exists("priceInfo"$context) ? $context["priceInfo"] : (function () { throw new RuntimeError('Variable "priceInfo" does not exist.'24$this->source); })()), "hasDiscount", [], "any"falsefalsetrue24)) {
  95.             // line 25
  96.             echo "                    <p class=\"card-price original mb-1\">";
  97.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["priceInfo"]) || array_key_exists("priceInfo"$context) ? $context["priceInfo"] : (function () { throw new RuntimeError('Variable "priceInfo" does not exist.'25$this->source); })()), "originalPrice", [], "any"falsefalsetrue25), 25$this->source), "html"nulltrue);
  98.             echo "</p>
  99.                 ";
  100.         }
  101.         // line 27
  102.         echo "
  103.                 <p class=\"card-price\">";
  104.         // line 28
  105.         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.'28$this->source); })()), "oSPrice", [], "any"falsefalsetrue28), 28$this->source), "html"nulltrue);
  106.         echo "</p>
  107.                 <div class=\"row button-row\">
  108.                     <div class=\"col p-1\">
  109.                         <a href=\"";
  110.         // line 31
  111.         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.'31$this->source); })()), 31$this->source), "html"nulltrue);
  112.         echo "\" class=\"btn btn-block btn-secondary\">
  113.                             ";
  114.         // line 32
  115.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.details"), "html"nulltrue);
  116.         echo "
  117.                         </a>
  118.                     </div>
  119.                     <div class=\"col p-1\">
  120.                         <a href=\"";
  121.         // line 36
  122.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("shop-add-to-cart", ["id" => 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.'36$this->source); })()), "id", [], "any"falsefalsetrue36)]), "html"nulltrue);
  123.         echo "\" class=\"btn btn-block btn-primary\">";
  124.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.buy"), "html"nulltrue);
  125.         echo " <i class=\" ml-2\"><img src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  126.                     </div>
  127.                 </div>
  128.             </div>
  129.         </div>
  130.     </a>
  131. </div>
  132. ";
  133.         
  134.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  135.         
  136.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  137.     }
  138.     /**
  139.      * @codeCoverageIgnore
  140.      */
  141.     public function getTemplateName()
  142.     {
  143.         return "product/product_teaser.html.twig";
  144.     }
  145.     /**
  146.      * @codeCoverageIgnore
  147.      */
  148.     public function isTraitable()
  149.     {
  150.         return false;
  151.     }
  152.     /**
  153.      * @codeCoverageIgnore
  154.      */
  155.     public function getDebugInfo()
  156.     {
  157.         return array (  133 => 36,  126 => 32,  122 => 31,  116 => 28,  113 => 27,  107 => 25,  105 => 24,  102 => 23,  100 => 22,  95 => 19,  87 => 17,  85 => 16,  80 => 15,  78 => 14,  74 => 13,  68 => 9,  62 => 6,  59 => 5,  57 => 4,  52 => 3,  50 => 2,  45 => 1,);
  158.     }
  159.     public function getSourceContext()
  160.     {
  161.         return new Source("<div class=\"card custom-product-card mb-4 shadow-sm flex-fill\" data-productid=\"{{ product.id }}\">
  162.     {% set detailLink = app_product_detaillink(product) %}
  163.     <a href=\"{{ detailLink }}\" class=\"text-decoration-none text-dark\">
  164.         {% if(product.mainImage) %}
  165.         <div class=\"product-img\">
  166.             {{ product.mainImage.thumbnail('grid').html({imgAttributes: {class: 'img-fluid w-100'}}) | raw }}
  167.         </div>
  168.         {% endif %}
  169.         <div class=\"card-body pricing\">
  170.             <div class=\"card-body-top pb-3\">
  171.                 <h4 class=\"card-title pricing-card-title text-uppercase\">{{ product.oSName }}</h4>
  172.                 {% if( product is instanceof('App\\\\Model\\\\Product\\\\Car')) %}
  173.                     <p class=\"card-text\">{{ product.subText | raw }}</p>
  174.                 {% elseif(product.saleInformation.saleInformation)  %}
  175.                     <p class=\"card-text\">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  176.                 {% endif %}
  177.             </div>
  178.             <div class=\"card-body-bottom\">
  179.                 {% set priceInfo = product.oSPriceInfo %}
  180.                 {% if(priceInfo.hasDiscount) %}
  181.                     <p class=\"card-price original mb-1\">{{ priceInfo.originalPrice }}</p>
  182.                 {% endif %}
  183.                 <p class=\"card-price\">{{ product.oSPrice }}</p>
  184.                 <div class=\"row button-row\">
  185.                     <div class=\"col p-1\">
  186.                         <a href=\"{{ detailLink }}\" class=\"btn btn-block btn-secondary\">
  187.                             {{ 'general.details' | trans }}
  188.                         </a>
  189.                     </div>
  190.                     <div class=\"col p-1\">
  191.                         <a href=\"{{ path('shop-add-to-cart', { id: product.id }) }}\" class=\"btn btn-block btn-primary\">{{ 'general.buy' | trans }} <i class=\" ml-2\"><img src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  192.                     </div>
  193.                 </div>
  194.             </div>
  195.         </div>
  196.     </a>
  197. </div>
  198. ""product/product_teaser.html.twig""/var/www/html/templates/product/product_teaser.html.twig");
  199.     }
  200.     
  201.     public function checkSecurity()
  202.     {
  203.         static $tags = array("set" => 2"if" => 4);
  204.         static $filters = array("escape" => 1"raw" => 6"trans" => 17);
  205.         static $functions = array("app_product_detaillink" => 2"path" => 36);
  206.         try {
  207.             $this->sandbox->checkSecurity(
  208.                 ['set''if'],
  209.                 ['escape''raw''trans'],
  210.                 ['app_product_detaillink''path']
  211.             );
  212.         } catch (SecurityError $e) {
  213.             $e->setSourceContext($this->source);
  214.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  215.                 $e->setTemplateLine($tags[$e->getTagName()]);
  216.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  217.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  218.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  219.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  220.             }
  221.             throw $e;
  222.         }
  223.     }
  224. }