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

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 " ";
  136. }
  137. // line 27
  138. yield " </div>
  139. ";
  140. } elseif ((($tmp = CoreExtension::getAttribute($this->env, $this->source, // line 28
  141. (isset($context["customerMgr"]) || array_key_exists("customerMgr", $context) ? $context["customerMgr"] : (function () { throw new RuntimeError('Variable "customerMgr" does not exist.', 28, $this->source); })()), "isExpert", [], "method", false, false, false, 28)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  142. // line 29
  143. yield " <p>";
  144. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Produit non disponible pour les Experts", [], "messages");
  145. yield "</p>
  146. ";
  147. }
  148. // line 31
  149. yield " ";
  150. }
  151. // line 32
  152. yield " </div>
  153. </div>
  154. ";
  155. // line 34
  156. 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.', 34, $this->source); })()), "canSeePrices", [], "method", false, false, false, 34) && (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.', 34, $this->source); })()), "ecotax", [], "any", false, false, false, 34) > 0))) {
  157. // line 35
  158. yield " <div class=\"eco-tax\">";
  159. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("+ éco-participation", [], "messages");
  160. yield " : ";
  161. 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.', 35, $this->source); })()), "ecotax", [], "any", false, false, false, 35)), "html", null, true);
  162. yield "</div>
  163. ";
  164. }
  165. // line 37
  166. yield " ";
  167. 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.', 37, $this->source); })()), "canSeePrices", [], "method", false, false, false, 37) && !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.', 37, $this->source); })()), "isStopped", [], "method", false, false, false, 37)) && !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.', 37, $this->source); })()), "isAvailable", [], "method", false, false, false, 37))) {
  168. // line 38
  169. yield " <div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
  170. <a data-product=\"";
  171. // line 39
  172. 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.', 39, $this->source); })()), "id", [], "any", false, false, false, 39), "html", null, true);
  173. yield "\" data-customer=\"";
  174. 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.', 39, $this->source); })()), "id", [], "any", false, false, false, 39), "html", null, true);
  175. yield "\" data-language=\"";
  176. 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.', 39, $this->source); })()), "request", [], "any", false, false, false, 39), "getLocale", [], "method", false, false, false, 39), "html", null, true);
  177. yield "\" class=\"bt-stock-alert\">";
  178. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Prévenez-moi par email dès que l\x27article est en stock.", [], "messages");
  179. yield "</a><br>
  180. </div>
  181. ";
  182. }
  183. // line 42
  184. yield "</div>";
  185. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  186. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  187. yield from [];
  188. }
  189. /**
  190. * @codeCoverageIgnore
  191. */
  192. public function getTemplateName(): string
  193. {
  194. return "front/catalog/product/view/reference-line.html.twig";
  195. }
  196. /**
  197. * @codeCoverageIgnore
  198. */
  199. public function isTraitable(): bool
  200. {
  201. return false;
  202. }
  203. /**
  204. * @codeCoverageIgnore
  205. */
  206. public function getDebugInfo(): array
  207. {
  208. return array ( 193 => 42, 181 => 39, 178 => 38, 175 => 37, 167 => 35, 165 => 34, 161 => 32, 158 => 31, 152 => 29, 150 => 28, 147 => 27, 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,);
  209. }
  210. public function getSourceContext(): Source
  211. {
  212. return new Source("<div class=\"reference\">
  213. {% set country = customerMgr.getCustomerCountry() %}
  214. <div class=\"reference-ctn\">
  215. {% include \x27front/catalog/product/view/soleil.html.twig\x27 %}
  216. <div class=\"stock-ctn\">
  217. {% include \x27front/catalog/product/view/stock.html.twig\x27 %}
  218. {% if product.isAvailableForCountry(country) %}
  219. {% if product.id in discounts|keys %}
  220. {% set productsDiscounts = attribute(discounts, product.id) %}
  221. {% for discount in productsDiscounts %}
  222. {% include \x27front/catalog/product/view/discount.html.twig\x27 with {discount:discount} %}
  223. {% endfor %}
  224. {% endif %}
  225. {% endif %}
  226. </div>
  227. <div class=\"name-ctn\">
  228. {% if product.isAvailableForCountry(country) %}
  229. {% if product.getPrice(false, priceGroup) %}
  230. {% if customerMgr.canSeePrices() and not product.isStopped() %}
  231. {% include \x27front/catalog/product/view/price-grid.html.twig\x27 with {priceGrid:attribute(priceGrids,product.id)} %}
  232. {% endif %}
  233. {% set currentQty = cartMgr.qtyInCart(product) %}
  234. <div class=\"bt-cart {{ currentQty > 0 ? \x27in-cart\x27 : \x27\x27}}\">
  235. {% if customerMgr.canSeePrices() and product.isAvailable() %}
  236. {% include \x27front/cart/bt.html.twig\x27 with {product:product} %}
  237. {% endif %}
  238. </div>
  239. {% elseif customerMgr.isExpert() %}
  240. <p>{% trans %}Produit non disponible pour les Experts{% endtrans %}</p>
  241. {% endif %}
  242. {% endif %}
  243. </div>
  244. </div>
  245. {% if customerMgr.canSeePrices() and (product.ecotax > 0) %}
  246. <div class=\"eco-tax\">{% trans %}+ éco-participation{% endtrans %} : {{ product.ecotax|price }}</div>
  247. {% endif %}
  248. {% if customerMgr.canSeePrices() and not product.isStopped() and not product.isAvailable() %}
  249. <div class=\"stock-alert\" style=\"height:30px; line-height:15px;\">
  250. <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>
  251. </div>
  252. {% endif %}
  253. </div>", "front/catalog/product/view/reference-line.html.twig", "/var/www/dogcat.com/pim/templates/front/catalog/product/view/reference-line.html.twig");
  254. }
  255. }