var/cache/dev/twig/a9/a999fb1037ca421532c8b701993318dc.php line 61

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