<?php
use Twig\Environment;
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;
/* product/product_teaser.html.twig */
class __TwigTemplate_1f4b34abc009e3027ec8ccd10ba4f34e extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
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", "product/product_teaser.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "product/product_teaser.html.twig"));
// line 1
$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));
// line 2
echo "
<a href=\"";
// line 3
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", null, true);
echo "\" class=\"relative flex flex-col overflow-hidden bg-gray-100 hover:shadow-xl-center rounded-lg transition ease duration-300\">
<div class=\"w-full overflow-hidden lg:h-50 px-3 pt-3\">
";
// line 5
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", false, false, true, 5))) ? (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, 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", false, false, true, 5), "thumbnail", [0 => "productThumbnail"], "method", false, false, true, 5), "html", [], "any", false, false, true, 5)) : (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, Pimcore\Model\Asset::getByPath("/System/missing.png"), "thumbnail", [0 => "productThumbnail"], "method", false, false, true, 5), "html", [], "any", false, false, true, 5)));
echo " ";
// line 6
echo " </div>
";
// line 7
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", false, false, true, 7)) && 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", false, false, true, 7)))) {
// line 8
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>
";
} elseif (twig_get_attribute($this->env, $this->source, // line 9
(isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 9, $this->source); })()), "discontinued", [], "any", false, false, true, 9)) {
// line 10
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>
";
}
// line 12
echo " ";
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", false, false, true, 12)) {
// line 13
echo " <div class=\"flex\" style=\"max-width: 9rem\">
<span class=\"text-white text-sm rounded-r-full pl-4 pr-8 py-1 w-fit mt-4\" style=\"background-color: ";
// line 14
echo twig_escape_filter($this->env, twig_slice($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, 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.', 14, $this->source); })()), "productGroup", [], "any", false, false, true, 14), "color", [], "any", false, false, true, 14), 14, $this->source), 0, 7), "html", null, true);
echo ";\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, 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.', 14, $this->source); })()), "productGroup", [], "any", false, false, true, 14), "name", [], "any", false, false, true, 14), 14, $this->source), "html", null, true);
echo "</span>
</div>
";
}
// line 17
echo " <div class=\"p-4 flex flex-1 flex-col space-y-2\">
<h3 class=\"text-md text-gray-900 leading-tight\">
";
// line 19
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", false, false, true, 19), 19, $this->source), "html", null, true);
echo "
</h3>
<div class=\"flex flex-1 flex-col justify-end\">
<p class=\"text-sm text-gray-500\">";
// line 22
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", false, false, true, 22), 22, $this->source), "html", null, true);
echo "</p>
</div>
</div>
</a>";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "product/product_teaser.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% set detailLink = app_product_detaillink(product) %}
<a href=\"{{ detailLink }}\" class=\"relative flex flex-col overflow-hidden bg-gray-100 hover:shadow-xl-center rounded-lg transition ease duration-300\">
<div class=\"w-full overflow-hidden lg:h-50 px-3 pt-3\">
{{ (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\" #}
</div>
{% if product.specialities is not empty and \"Special Deal\" in product.specialities %}
<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>
{% elseif product.discontinued %}
<span class=\"absolute top-2 right-2 bg-brand-600 text-center text-white text-xs rounded-full px-2 py-1\">Auslaufartikel</span>
{% endif %}
{% if product.productGroup %}
<div class=\"flex\" style=\"max-width: 9rem\">
<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>
</div>
{% endif %}
<div class=\"p-4 flex flex-1 flex-col space-y-2\">
<h3 class=\"text-md text-gray-900 leading-tight\">
{{ product.name }}
</h3>
<div class=\"flex flex-1 flex-col justify-end\">
<p class=\"text-sm text-gray-500\">{{ product.code }}</p>
</div>
</div>
</a>", "product/product_teaser.html.twig", "/var/www/html/templates/product/product_teaser.html.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 1, "if" => 7);
static $filters = array("escape" => 3, "raw" => 5, "slice" => 14);
static $functions = array("app_product_detaillink" => 1, "pimcore_asset_by_path" => 5);
try {
$this->sandbox->checkSecurity(
['set', 'if'],
['escape', 'raw', 'slice'],
['app_product_detaillink', 'pimcore_asset_by_path']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}