var/cache/dev/twig/c6/c60bcd0c3ea87121561bbba7e6fa1a79.php line 33

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_5e8cddd2566bd7d1a825fc65d019fb71 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.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""product/product_teaser.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""product/product_teaser.html.twig"));
  33.         // line 1
  34.         echo "<div class=\"card custom-product-card mb-4 shadow-sm flex-fill\" data-productid=\"";
  35.         echo twig_escape_filter($this->envtwig_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"falsefalsefalse1), "html"nulltrue);
  36.         echo "\">
  37.     ";
  38.         // line 2
  39.         $context["detailLink"] = $this->extensions['App\Twig\Extension\ProductPageExtension']->generateLink((isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'2$this->source); })()));
  40.         // line 3
  41.         echo "    <a href=\"";
  42.         echo twig_escape_filter($this->env, (isset($context["detailLink"]) || array_key_exists("detailLink"$context) ? $context["detailLink"] : (function () { throw new RuntimeError('Variable "detailLink" does not exist.'3$this->source); })()), "html"nulltrue);
  43.         echo "\" class=\"text-decoration-none text-dark\">
  44.         ";
  45.         // line 4
  46.         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"falsefalsefalse4)) {
  47.             // line 5
  48.             echo "        <div class=\"product-img\">
  49.             ";
  50.             // line 6
  51.             echo 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"falsefalsefalse6), "thumbnail", [=> "grid"], "method"falsefalsefalse6), "html", [=> ["imgAttributes" => ["class" => "img-fluid w-100"]]], "method"falsefalsefalse6);
  52.             echo "
  53.         </div>
  54.         ";
  55.         }
  56.         // line 9
  57.         echo "
  58.         <div class=\"card-body pricing\">
  59.             <div class=\"card-body-top pb-3\">
  60.                 <h4 class=\"card-title pricing-card-title text-uppercase\">";
  61.         // line 13
  62.         echo twig_escape_filter($this->envtwig_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"falsefalsefalse13), "html"nulltrue);
  63.         echo "</h4>
  64.                 ";
  65.         // line 14
  66.         if (call_user_func_array($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"])) {
  67.             // line 15
  68.             echo "                    <p class=\"card-text\">";
  69.             echo 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"falsefalsefalse15);
  70.             echo "</p>
  71.                 ";
  72.         } elseif (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,         // line 16
  73. (isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'16$this->source); })()), "saleInformation", [], "any"falsefalsefalse16), "saleInformation", [], "any"falsefalsefalse16)) {
  74.             // line 17
  75.             echo "                    <p class=\"card-text\">";
  76.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.condition"), "html"nulltrue);
  77.             echo ": ";
  78.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("attribute." 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"falsefalsefalse17), "saleInformation", [], "any"falsefalsefalse17), "condition", [], "any"falsefalsefalse17))), "html"nulltrue);
  79.             echo "</p>
  80.                 ";
  81.         }
  82.         // line 19
  83.         echo "            </div>
  84.             <div class=\"card-body-bottom\">
  85.                 ";
  86.         // line 22
  87.         $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"falsefalsefalse22);
  88.         // line 23
  89.         echo "
  90.                 ";
  91.         // line 24
  92.         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"falsefalsefalse24)) {
  93.             // line 25
  94.             echo "                    <p class=\"card-price original mb-1\">";
  95.             echo twig_escape_filter($this->envtwig_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"falsefalsefalse25), "html"nulltrue);
  96.             echo "</p>
  97.                 ";
  98.         }
  99.         // line 27
  100.         echo "
  101.                 <p class=\"card-price\">";
  102.         // line 28
  103.         echo twig_escape_filter($this->envtwig_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"falsefalsefalse28), "html"nulltrue);
  104.         echo "</p>
  105.                 <div class=\"row button-row\">
  106.                     <div class=\"col p-1\">
  107.                         <a href=\"";
  108.         // line 31
  109.         echo twig_escape_filter($this->env, (isset($context["detailLink"]) || array_key_exists("detailLink"$context) ? $context["detailLink"] : (function () { throw new RuntimeError('Variable "detailLink" does not exist.'31$this->source); })()), "html"nulltrue);
  110.         echo "\" class=\"btn btn-block btn-secondary\">
  111.                             ";
  112.         // line 32
  113.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.details"), "html"nulltrue);
  114.         echo "
  115.                         </a>
  116.                     </div>
  117.                     <div class=\"col p-1\">
  118.                         <form id=\"shop_add_to_cart_form_";
  119.         // line 36
  120.         echo twig_escape_filter($this->envtwig_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"falsefalsefalse36), "html"nulltrue);
  121.         echo "\" method=\"post\" action=\"";
  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"falsefalsefalse36)]), "html"nulltrue);
  123.         echo "\">
  124.                             <input type=\"hidden\" name=\"_csrf_token\" value=\"";
  125.         // line 37
  126.         echo twig_escape_filter($this->env$this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken("addToCart"), "html"nulltrue);
  127.         echo "\">
  128.                             <a href=\"#\" onclick=\"document.getElementById('shop_add_to_cart_form_";
  129.         // line 38
  130.         echo twig_escape_filter($this->envtwig_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"falsefalsefalse38), "html"nulltrue);
  131.         echo "').submit();\"
  132.                                class=\"btn btn-block btn-primary\">";
  133.         // line 39
  134.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("general.buy"), "html"nulltrue);
  135.         echo " <i class=\" ml-2\"><img
  136.                                         src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  137.                         </form>
  138.                     </div>
  139.                 </div>
  140.             </div>
  141.         </div>
  142.     </a>
  143. </div>
  144. ";
  145.         
  146.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  147.         
  148.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  149.     }
  150.     public function getTemplateName()
  151.     {
  152.         return "product/product_teaser.html.twig";
  153.     }
  154.     public function isTraitable()
  155.     {
  156.         return false;
  157.     }
  158.     public function getDebugInfo()
  159.     {
  160.         return array (  145 => 39,  141 => 38,  137 => 37,  131 => 36,  124 => 32,  120 => 31,  114 => 28,  111 => 27,  105 => 25,  103 => 24,  100 => 23,  98 => 22,  93 => 19,  85 => 17,  83 => 16,  78 => 15,  76 => 14,  72 => 13,  66 => 9,  60 => 6,  57 => 5,  55 => 4,  50 => 3,  48 => 2,  43 => 1,);
  161.     }
  162.     public function getSourceContext()
  163.     {
  164.         return new Source("<div class=\"card custom-product-card mb-4 shadow-sm flex-fill\" data-productid=\"{{ product.id }}\">
  165.     {% set detailLink = app_product_detaillink(product) %}
  166.     <a href=\"{{ detailLink }}\" class=\"text-decoration-none text-dark\">
  167.         {% if(product.mainImage) %}
  168.         <div class=\"product-img\">
  169.             {{ product.mainImage.thumbnail('grid').html({imgAttributes: {class: 'img-fluid w-100'}}) | raw }}
  170.         </div>
  171.         {% endif %}
  172.         <div class=\"card-body pricing\">
  173.             <div class=\"card-body-top pb-3\">
  174.                 <h4 class=\"card-title pricing-card-title text-uppercase\">{{ product.oSName }}</h4>
  175.                 {% if( product is instanceof('App\\\\Model\\\\Product\\\\Car')) %}
  176.                     <p class=\"card-text\">{{ product.subText | raw }}</p>
  177.                 {% elseif(product.saleInformation.saleInformation)  %}
  178.                     <p class=\"card-text\">{{ 'general.condition' | trans }}: {{ ('attribute.' ~ product.saleInformation.saleInformation.condition) | trans }}</p>
  179.                 {% endif %}
  180.             </div>
  181.             <div class=\"card-body-bottom\">
  182.                 {% set priceInfo = product.oSPriceInfo %}
  183.                 {% if(priceInfo.hasDiscount) %}
  184.                     <p class=\"card-price original mb-1\">{{ priceInfo.originalPrice }}</p>
  185.                 {% endif %}
  186.                 <p class=\"card-price\">{{ product.oSPrice }}</p>
  187.                 <div class=\"row button-row\">
  188.                     <div class=\"col p-1\">
  189.                         <a href=\"{{ detailLink }}\" class=\"btn btn-block btn-secondary\">
  190.                             {{ 'general.details' | trans }}
  191.                         </a>
  192.                     </div>
  193.                     <div class=\"col p-1\">
  194.                         <form id=\"shop_add_to_cart_form_{{ product.id }}\" method=\"post\" action=\"{{ path('shop-add-to-cart', { id: product.id }) }}\">
  195.                             <input type=\"hidden\" name=\"_csrf_token\" value=\"{{ csrf_token('addToCart') }}\">
  196.                             <a href=\"#\" onclick=\"document.getElementById('shop_add_to_cart_form_{{ product.id }}').submit();\"
  197.                                class=\"btn btn-block btn-primary\">{{ 'general.buy' | trans }} <i class=\" ml-2\"><img
  198.                                         src=\"/static/images/icons/cart.svg\" height=\"20\" width=\"auto\"></i></a>
  199.                         </form>
  200.                     </div>
  201.                 </div>
  202.             </div>
  203.         </div>
  204.     </a>
  205. </div>
  206. ""product/product_teaser.html.twig""/home/pimcore/pim10cars/templates/product/product_teaser.html.twig");
  207.     }
  208. }