var/cache/dev/twig/22/22d575e3a11474a3b3f25408e14650c5.php line 122

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* front/catalog/model/view/reference-line.html.twig */
  16. class __TwigTemplate_8a9b5fdb5ddd6d42082b9be882c0513a extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->parent = false;
  28. $this->blocks = [
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = []): iterable
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/catalog/model/view/reference-line.html.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/catalog/model/view/reference-line.html.twig"));
  38. // line 1
  39. yield "<div class=\"reference reference-line\" id=\"reference-";
  40. 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);
  41. yield "\">
  42. ";
  43. // line 2
  44. $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);
  45. // line 3
  46. yield " <div class=\"reference-ctn\">
  47. ";
  48. // line 4
  49. yield from $this->load("front/catalog/product/view/soleil.html.twig", 4)->unwrap()->yield($context);
  50. // line 5
  51. yield " <div class=\"stock-ctn\">
  52. ";
  53. // line 6
  54. yield from $this->load("front/catalog/product/view/stock.html.twig", 6)->unwrap()->yield($context);
  55. // line 7
  56. yield " ";
  57. 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)) {
  58. // line 8
  59. yield " ";
  60. 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); })())))) {
  61. // line 9
  62. yield " ";
  63. $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);
  64. // line 10
  65. yield " ";
  66. $context['_parent'] = $context;
  67. $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); })()));
  68. $context['loop'] = [
  69. 'parent' => $context['_parent'],
  70. 'index0' => 0,
  71. 'index' => 1,
  72. 'first' => true,
  73. ];
  74. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  75. $length = count($context['_seq']);
  76. $context['loop']['revindex0'] = $length - 1;
  77. $context['loop']['revindex'] = $length;
  78. $context['loop']['length'] = $length;
  79. $context['loop']['last'] = 1 === $length;
  80. }
  81. foreach ($context['_seq'] as $context["_key"] => $context["discount"]) {
  82. // line 11
  83. yield " ";
  84. yield from $this->load("front/catalog/product/view/discount.html.twig", 11)->unwrap()->yield(CoreExtension::merge($context, ["discount" => $context["discount"]]));
  85. // line 12
  86. yield " ";
  87. ++$context['loop']['index0'];
  88. ++$context['loop']['index'];
  89. $context['loop']['first'] = false;
  90. if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  91. --$context['loop']['revindex0'];
  92. --$context['loop']['revindex'];
  93. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  94. }
  95. }
  96. $_parent = $context['_parent'];
  97. unset($context['_seq'], $context['_key'], $context['discount'], $context['_parent'], $context['loop']);
  98. $context = array_intersect_key($context, $_parent) + $_parent;
  99. // line 13
  100. yield " ";
  101. }
  102. // line 14
  103. yield " ";
  104. }
  105. // line 15
  106. yield " </div>
  107. <div class=\"name-ctn\">
  108. ";
  109. // line 17
  110. 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)) {
  111. // line 18
  112. yield " ";
  113. 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)) {
  114. // line 19
  115. yield " ";
  116. 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))) {
  117. // line 20
  118. yield " ";
  119. 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)]));
  120. // line 21
  121. yield " ";
  122. }
  123. // line 22
  124. yield " ";
  125. $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);
  126. // line 23
  127. yield " <div class=\"bt-cart ";
  128. 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") : (""));
  129. yield "\">
  130. ";
  131. // line 24
  132. 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))) {
  133. // line 25
  134. yield " ";
  135. 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); })())]));
  136. // line 26
  137. yield " <div class=\"qty\">
  138. <a class=\"down\">-</a>
  139. <input type=\"text\" value=\"";
  140. // line 28
  141. 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);
  142. yield "\" name=\"qty[";
  143. 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);
  144. yield "]\" class=\"qty-value\" data-id=\"";
  145. 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);
  146. yield "\">
  147. <a class=\"up\">+</a>
  148. </div>
  149. ";
  150. }
  151. // line 32
  152. yield " </div>
  153. ";
  154. } elseif ((($tmp = CoreExtension::getAttribute($this->env, $this->source, // line 33
  155. (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)) {
  156. // line 34
  157. yield " <p>";
  158. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Produit non disponible pour les Experts", [], "messages");
  159. yield "</p>
  160. ";
  161. }
  162. // line 36
  163. yield " ";
  164. }
  165. // line 37
  166. yield " </div>
  167. </div>
  168. ";
  169. // line 39
  170. 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))) {
  171. // line 40
  172. yield " <div class=\"eco-tax\">";
  173. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("+ éco-participation", [], "messages");
  174. yield " : ";
  175. 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);
  176. yield "</div>
  177. ";
  178. }
  179. // line 42
  180. yield " ";
  181. 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))) {
  182. // line 43
  183. yield " <div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
  184. <a data-product=\"";
  185. // line 44
  186. 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);
  187. yield "\" data-customer=\"";
  188. 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);
  189. yield "\" data-language=\"";
  190. 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);
  191. yield "\" class=\"bt-stock-alert\">";
  192. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Prévenez-moi par email dès que l\x27article est en stock.", [], "messages");
  193. yield "</a><br>
  194. </div>
  195. ";
  196. }
  197. // line 47
  198. yield "</div>";
  199. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  200. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  201. yield from [];
  202. }
  203. /**
  204. * @codeCoverageIgnore
  205. */
  206. public function getTemplateName(): string
  207. {
  208. return "front/catalog/model/view/reference-line.html.twig";
  209. }
  210. /**
  211. * @codeCoverageIgnore
  212. */
  213. public function isTraitable(): bool
  214. {
  215. return false;
  216. }
  217. /**
  218. * @codeCoverageIgnore
  219. */
  220. public function getDebugInfo(): array
  221. {
  222. 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,);
  223. }
  224. public function getSourceContext(): Source
  225. {
  226. return new Source("<div class=\"reference reference-line\" id=\"reference-{{ product.id }}\">
  227. {% set country = customerMgr.getCustomerCountry() %}
  228. <div class=\"reference-ctn\">
  229. {% include \x27front/catalog/product/view/soleil.html.twig\x27 %}
  230. <div class=\"stock-ctn\">
  231. {% include \x27front/catalog/product/view/stock.html.twig\x27 %}
  232. {% if product.isAvailableForCountry(country) %}
  233. {% if product.id in discounts|keys %}
  234. {% set productsDiscounts = attribute(discounts, product.id) %}
  235. {% for discount in productsDiscounts %}
  236. {% include \x27front/catalog/product/view/discount.html.twig\x27 with {discount:discount} %}
  237. {% endfor %}
  238. {% endif %}
  239. {% endif %}
  240. </div>
  241. <div class=\"name-ctn\">
  242. {% if product.isAvailableForCountry(country) %}
  243. {% if product.getPrice(false, priceGroup) %}
  244. {% if customerMgr.canSeePrices() and not product.isStopped() %}
  245. {% include \x27front/catalog/product/view/price-grid.html.twig\x27 with {priceGrid:attribute(priceGrids,product.id)} %}
  246. {% endif %}
  247. {% set currentQty = cartMgr.qtyInCart(product) %}
  248. <div class=\"bt-cart {{ currentQty > 0 ? \x27in-cart\x27 : \x27\x27}}\">
  249. {% if customerMgr.canSeePrices() and product.isAvailable() %}
  250. {% include \x27front/cart/bt.html.twig\x27 with {product:product} %}
  251. <div class=\"qty\">
  252. <a class=\"down\">-</a>
  253. <input type=\"text\" value=\"{{ currentQty }}\" name=\"qty[{{ product.id }}]\" class=\"qty-value\" data-id=\"{{ product.id }}\">
  254. <a class=\"up\">+</a>
  255. </div>
  256. {% endif %}
  257. </div>
  258. {% elseif customerMgr.isExpert() %}
  259. <p>{% trans %}Produit non disponible pour les Experts{% endtrans %}</p>
  260. {% endif %}
  261. {% endif %}
  262. </div>
  263. </div>
  264. {% if customerMgr.canSeePrices() and (product.ecotax > 0) %}
  265. <div class=\"eco-tax\">{% trans %}+ éco-participation{% endtrans %} : {{ product.ecotax|price }}</div>
  266. {% endif %}
  267. {% if customerMgr.canSeePrices() and not product.isStopped() and not product.isAvailable() %}
  268. <div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
  269. <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>
  270. </div>
  271. {% endif %}
  272. </div>", "front/catalog/model/view/reference-line.html.twig", "/var/www/dogcat.com/pim/templates/front/catalog/model/view/reference-line.html.twig");
  273. }
  274. }