var/cache/dev/twig/74/74131e349aeaae3bed87ad6841c8bb2e.php line 100

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_77dfa3bbbc8b35ce021d665b1cb4cdf3 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.                         <form id=\"shop_add_to_cart_form_";
  121.         // line 36
  122.         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.'36$this->source); })()), "id", [], "any"falsefalsetrue36), 36$this->source), "html"nulltrue);
  123.         echo "\" method=\"post\" action=\"";
  124.         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);
  125.         echo "\">
  126.                             <input type=\"hidden\" name=\"_csrf_token\" value=\"";
  127.         // line 37
  128.         echo twig_escape_filter($this->env$this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken("addToCart"), "html"nulltrue);
  129.         echo "\">
  130.                             <a href=\"#\" onclick=\"document.getElementById('shop_add_to_cart_form_";
  131.         // line 38
  132.         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.'38$this->source); })()), "id", [], "any"falsefalsetrue38), 38$this->source), "html"nulltrue);
  133.         echo "').submit();\"
  134.                                class=\"btn btn-block btn-primary\">";
  135.         // line 39
  136.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.buy"), "html"nulltrue);
  137.         echo " <i class=\" ml-2\"><img
  138.                                         src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  139.                         </form>
  140.                     </div>
  141.                 </div>
  142.             </div>
  143.         </div>
  144.     </a>
  145. </div>
  146. ";
  147.         
  148.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  149.         
  150.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  151.     }
  152.     /**
  153.      * @codeCoverageIgnore
  154.      */
  155.     public function getTemplateName()
  156.     {
  157.         return "product/product_teaser.html.twig";
  158.     }
  159.     /**
  160.      * @codeCoverageIgnore
  161.      */
  162.     public function isTraitable()
  163.     {
  164.         return false;
  165.     }
  166.     /**
  167.      * @codeCoverageIgnore
  168.      */
  169.     public function getDebugInfo()
  170.     {
  171.         return array (  147 => 39,  143 => 38,  139 => 37,  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,);
  172.     }
  173.     public function getSourceContext()
  174.     {
  175.         return new Source("<div class=\"card custom-product-card mb-4 shadow-sm flex-fill\" data-productid=\"{{ product.id }}\">
  176.     {% set detailLink = app_product_detaillink(product) %}
  177.     <a href=\"{{ detailLink }}\" class=\"text-decoration-none text-dark\">
  178.         {% if(product.mainImage) %}
  179.         <div class=\"product-img\">
  180.             {{ product.mainImage.thumbnail('grid').html({imgAttributes: {class: 'img-fluid w-100'}}) | raw }}
  181.         </div>
  182.         {% endif %}
  183.         <div class=\"card-body pricing\">
  184.             <div class=\"card-body-top pb-3\">
  185.                 <h4 class=\"card-title pricing-card-title text-uppercase\">{{ product.oSName }}</h4>
  186.                 {% if( product is instanceof('App\\\\Model\\\\Product\\\\Car')) %}
  187.                     <p class=\"card-text\">{{ product.subText | raw }}</p>
  188.                 {% elseif(product.saleInformation.saleInformation)  %}
  189.                     <p class=\"card-text\">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  190.                 {% endif %}
  191.             </div>
  192.             <div class=\"card-body-bottom\">
  193.                 {% set priceInfo = product.oSPriceInfo %}
  194.                 {% if(priceInfo.hasDiscount) %}
  195.                     <p class=\"card-price original mb-1\">{{ priceInfo.originalPrice }}</p>
  196.                 {% endif %}
  197.                 <p class=\"card-price\">{{ product.oSPrice }}</p>
  198.                 <div class=\"row button-row\">
  199.                     <div class=\"col p-1\">
  200.                         <a href=\"{{ detailLink }}\" class=\"btn btn-block btn-secondary\">
  201.                             {{ 'general.details' | trans }}
  202.                         </a>
  203.                     </div>
  204.                     <div class=\"col p-1\">
  205.                         <form id=\"shop_add_to_cart_form_{{ product.id }}\" method=\"post\" action=\"{{ path('shop-add-to-cart', { id: product.id }) }}\">
  206.                             <input type=\"hidden\" name=\"_csrf_token\" value=\"{{ csrf_token('addToCart') }}\">
  207.                             <a href=\"#\" onclick=\"document.getElementById('shop_add_to_cart_form_{{ product.id }}').submit();\"
  208.                                class=\"btn btn-block btn-primary\">{{ 'general.buy' | trans }} <i class=\" ml-2\"><img
  209.                                         src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  210.                         </form>
  211.                     </div>
  212.                 </div>
  213.             </div>
  214.         </div>
  215.     </a>
  216. </div>
  217. ""product/product_teaser.html.twig""/var/www/dev-10/templates/product/product_teaser.html.twig");
  218.     }
  219.     
  220.     public function checkSecurity()
  221.     {
  222.         static $tags = array("set" => 2"if" => 4);
  223.         static $filters = array("escape" => 1"raw" => 6"trans" => 17);
  224.         static $functions = array("app_product_detaillink" => 2"path" => 36"csrf_token" => 37);
  225.         try {
  226.             $this->sandbox->checkSecurity(
  227.                 ['set''if'],
  228.                 ['escape''raw''trans'],
  229.                 ['app_product_detaillink''path''csrf_token']
  230.             );
  231.         } catch (SecurityError $e) {
  232.             $e->setSourceContext($this->source);
  233.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  234.                 $e->setTemplateLine($tags[$e->getTagName()]);
  235.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  236.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  237.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  238.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  239.             }
  240.             throw $e;
  241.         }
  242.     }
  243. }