<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;
use Twig\TemplateWrapper;
/* front/catalog/model/view/reference-line.html.twig */
class __TwigTemplate_8a9b5fdb5ddd6d42082b9be882c0513a extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$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", "front/catalog/model/view/reference-line.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/catalog/model/view/reference-line.html.twig"));
// line 1
yield "<div class=\"reference reference-line\" id=\"reference-";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($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", false, false, false, 1), "html", null, true);
yield "\">
";
// line 2
$context["country"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 2, $this->source); })()), "getCustomerCountry", [], "method", false, false, false, 2);
// line 3
yield " <div class=\"reference-ctn\">
";
// line 4
yield from $this->load("front/catalog/product/view/soleil.html.twig", 4)->unwrap()->yield($context);
// line 5
yield " <div class=\"stock-ctn\">
";
// line 6
yield from $this->load("front/catalog/product/view/stock.html.twig", 6)->unwrap()->yield($context);
// line 7
yield " ";
if ((($tmp = CoreExtension::getAttribute($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); })()), "isAvailableForCountry", [(isset($context["country"]) || array_key_exists("country", $context) ? $context["country"] : (function () { throw new RuntimeError('Variable "country" does not exist.', 7, $this->source); })())], "method", false, false, false, 7)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 8
yield " ";
if (CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 8, $this->source); })()), "id", [], "any", false, false, false, 8), Twig\Extension\CoreExtension::keys((isset($context["discounts"]) || array_key_exists("discounts", $context) ? $context["discounts"] : (function () { throw new RuntimeError('Variable "discounts" does not exist.', 8, $this->source); })())))) {
// line 9
yield " ";
$context["productsDiscounts"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["discounts"]) || array_key_exists("discounts", $context) ? $context["discounts"] : (function () { throw new RuntimeError('Variable "discounts" does not exist.', 9, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 9, $this->source); })()), "id", [], "any", false, false, false, 9), [], "any", false, false, false, 9);
// line 10
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["productsDiscounts"]) || array_key_exists("productsDiscounts", $context) ? $context["productsDiscounts"] : (function () { throw new RuntimeError('Variable "productsDiscounts" does not exist.', 10, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["discount"]) {
// line 11
yield " ";
yield from $this->load("front/catalog/product/view/discount.html.twig", 11)->unwrap()->yield(CoreExtension::merge($context, ["discount" => $context["discount"]]));
// line 12
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['discount'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 13
yield " ";
}
// line 14
yield " ";
}
// line 15
yield " </div>
<div class=\"name-ctn\">
";
// line 17
if ((($tmp = CoreExtension::getAttribute($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); })()), "isAvailableForCountry", [(isset($context["country"]) || array_key_exists("country", $context) ? $context["country"] : (function () { throw new RuntimeError('Variable "country" does not exist.', 17, $this->source); })())], "method", false, false, false, 17)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 18
yield " ";
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 18, $this->source); })()), "getPrice", [false, (isset($context["priceGroup"]) || array_key_exists("priceGroup", $context) ? $context["priceGroup"] : (function () { throw new RuntimeError('Variable "priceGroup" does not exist.', 18, $this->source); })())], "method", false, false, false, 18)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 19
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 19, $this->source); })()), "canSeePrices", [], "method", false, false, false, 19) && !CoreExtension::getAttribute($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); })()), "isStopped", [], "method", false, false, false, 19))) {
// line 20
yield " ";
yield from $this->load("front/catalog/product/view/price-grid.html.twig", 20)->unwrap()->yield(CoreExtension::merge($context, ["priceGrid" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["priceGrids"]) || array_key_exists("priceGrids", $context) ? $context["priceGrids"] : (function () { throw new RuntimeError('Variable "priceGrids" does not exist.', 20, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 20, $this->source); })()), "id", [], "any", false, false, false, 20), [], "any", false, false, false, 20)]));
// line 21
yield " ";
}
// line 22
yield " ";
$context["currentQty"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["cartMgr"]) || array_key_exists("cartMgr", $context) ? $context["cartMgr"] : (function () { throw new RuntimeError('Variable "cartMgr" does not exist.', 22, $this->source); })()), "qtyInCart", [(isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 22, $this->source); })())], "method", false, false, false, 22);
// line 23
yield " <div class=\"bt-cart ";
yield ((((isset($context["currentQty"]) || array_key_exists("currentQty", $context) ? $context["currentQty"] : (function () { throw new RuntimeError('Variable "currentQty" does not exist.', 23, $this->source); })()) > 0)) ? ("in-cart") : (""));
yield "\">
";
// line 24
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 24, $this->source); })()), "canSeePrices", [], "method", false, false, false, 24) && CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 24, $this->source); })()), "isAvailable", [], "method", false, false, false, 24))) {
// line 25
yield " ";
yield from $this->load("front/cart/bt.html.twig", 25)->unwrap()->yield(CoreExtension::merge($context, ["product" => (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 25, $this->source); })())]));
// line 26
yield " <div class=\"qty\">
<a class=\"down\">-</a>
<input type=\"text\" value=\"";
// line 28
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["currentQty"]) || array_key_exists("currentQty", $context) ? $context["currentQty"] : (function () { throw new RuntimeError('Variable "currentQty" does not exist.', 28, $this->source); })()), "html", null, true);
yield "\" name=\"qty[";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($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); })()), "id", [], "any", false, false, false, 28), "html", null, true);
yield "]\" class=\"qty-value\" data-id=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($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); })()), "id", [], "any", false, false, false, 28), "html", null, true);
yield "\">
<a class=\"up\">+</a>
</div>
";
}
// line 32
yield " </div>
";
} elseif ((($tmp = CoreExtension::getAttribute($this->env, $this->source, // line 33
(isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 33, $this->source); })()), "isExpert", [], "method", false, false, false, 33)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 34
yield " <p>";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Produit non disponible pour les Experts", [], "messages");
yield "</p>
";
}
// line 36
yield " ";
}
// line 37
yield " </div>
</div>
";
// line 39
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 39, $this->source); })()), "canSeePrices", [], "method", false, false, false, 39) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 39, $this->source); })()), "ecotax", [], "any", false, false, false, 39) > 0))) {
// line 40
yield " <div class=\"eco-tax\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("+ éco-participation", [], "messages");
yield " : ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\PriceExtension']->priceFilter(CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 40, $this->source); })()), "ecotax", [], "any", false, false, false, 40)), "html", null, true);
yield "</div>
";
}
// line 42
yield " ";
if (((CoreExtension::getAttribute($this->env, $this->source, (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 42, $this->source); })()), "canSeePrices", [], "method", false, false, false, 42) && !CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 42, $this->source); })()), "isStopped", [], "method", false, false, false, 42)) && !CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 42, $this->source); })()), "isAvailable", [], "method", false, false, false, 42))) {
// line 43
yield " <div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
<a data-product=\"";
// line 44
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 44, $this->source); })()), "id", [], "any", false, false, false, 44), "html", null, true);
yield "\" data-customer=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 44, $this->source); })()), "id", [], "any", false, false, false, 44), "html", null, true);
yield "\" data-language=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 44, $this->source); })()), "request", [], "any", false, false, false, 44), "getLocale", [], "method", false, false, false, 44), "html", null, true);
yield "\" class=\"bt-stock-alert\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Prévenez-moi par email dès que l\x27article est en stock.", [], "messages");
yield "</a><br>
</div>
";
}
// line 47
yield "</div>";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "front/catalog/model/view/reference-line.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 207 => 47, 195 => 44, 192 => 43, 189 => 42, 181 => 40, 179 => 39, 175 => 37, 172 => 36, 166 => 34, 164 => 33, 161 => 32, 150 => 28, 146 => 26, 143 => 25, 141 => 24, 136 => 23, 133 => 22, 130 => 21, 127 => 20, 124 => 19, 121 => 18, 119 => 17, 115 => 15, 112 => 14, 109 => 13, 95 => 12, 92 => 11, 74 => 10, 71 => 9, 68 => 8, 65 => 7, 63 => 6, 60 => 5, 58 => 4, 55 => 3, 53 => 2, 48 => 1,);
}
public function getSourceContext(): Source
{
return new Source("<div class=\"reference reference-line\" id=\"reference-{{ product.id }}\">
{% set country = customerMgr.getCustomerCountry() %}
<div class=\"reference-ctn\">
{% include \x27front/catalog/product/view/soleil.html.twig\x27 %}
<div class=\"stock-ctn\">
{% include \x27front/catalog/product/view/stock.html.twig\x27 %}
{% if product.isAvailableForCountry(country) %}
{% if product.id in discounts|keys %}
{% set productsDiscounts = attribute(discounts, product.id) %}
{% for discount in productsDiscounts %}
{% include \x27front/catalog/product/view/discount.html.twig\x27 with {discount:discount} %}
{% endfor %}
{% endif %}
{% endif %}
</div>
<div class=\"name-ctn\">
{% if product.isAvailableForCountry(country) %}
{% if product.getPrice(false, priceGroup) %}
{% if customerMgr.canSeePrices() and not product.isStopped() %}
{% include \x27front/catalog/product/view/price-grid.html.twig\x27 with {priceGrid:attribute(priceGrids,product.id)} %}
{% endif %}
{% set currentQty = cartMgr.qtyInCart(product) %}
<div class=\"bt-cart {{ currentQty > 0 ? \x27in-cart\x27 : \x27\x27}}\">
{% if customerMgr.canSeePrices() and product.isAvailable() %}
{% include \x27front/cart/bt.html.twig\x27 with {product:product} %}
<div class=\"qty\">
<a class=\"down\">-</a>
<input type=\"text\" value=\"{{ currentQty }}\" name=\"qty[{{ product.id }}]\" class=\"qty-value\" data-id=\"{{ product.id }}\">
<a class=\"up\">+</a>
</div>
{% endif %}
</div>
{% elseif customerMgr.isExpert() %}
<p>{% trans %}Produit non disponible pour les Experts{% endtrans %}</p>
{% endif %}
{% endif %}
</div>
</div>
{% if customerMgr.canSeePrices() and (product.ecotax > 0) %}
<div class=\"eco-tax\">{% trans %}+ éco-participation{% endtrans %} : {{ product.ecotax|price }}</div>
{% endif %}
{% if customerMgr.canSeePrices() and not product.isStopped() and not product.isAvailable() %}
<div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
<a data-product=\"{{ product.id }}\" data-customer=\"{{ customer.id }}\" data-language=\"{{ app.request.getLocale() }}\" class=\"bt-stock-alert\">{% trans %}Prévenez-moi par email dès que l\x27article est en stock.{% endtrans %}</a><br>
</div>
{% endif %}
</div>", "front/catalog/model/view/reference-line.html.twig", "/var/www/dogcat.com/pim/templates/front/catalog/model/view/reference-line.html.twig");
}
}