var/cache/dev/twig/6e/6e6a25f58d4dbce6276263290eef607a.php line 50

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/cart/block.html.twig */
  16. class __TwigTemplate_d8e5b123ea0d47521a17fb5bfa5805e8 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/cart/block.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/cart/block.html.twig"));
  38. // line 1
  39. $context["nbProducts"] = 0;
  40. // line 2
  41. $context["cart"] = 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.', 2, $this->source); })()), "getCart", [], "method", false, false, false, 2);
  42. // line 3
  43. $context['_parent'] = $context;
  44. $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["cart"]) || array_key_exists("cart", $context) ? $context["cart"] : (function () { throw new RuntimeError('Variable "cart" does not exist.', 3, $this->source); })()), "items", [], "any", false, false, false, 3));
  45. foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  46. // line 4
  47. yield " ";
  48. $context["nbProducts"] = ((isset($context["nbProducts"]) || array_key_exists("nbProducts", $context) ? $context["nbProducts"] : (function () { throw new RuntimeError('Variable "nbProducts" does not exist.', 4, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["item"], "quantity", [], "any", false, false, false, 4));
  49. }
  50. $_parent = $context['_parent'];
  51. unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
  52. $context = array_intersect_key($context, $_parent) + $_parent;
  53. // line 6
  54. if ((($tmp = !array_key_exists("priceGroup", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  55. // line 7
  56. yield " ";
  57. $context["priceGroup"] = 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.', 7, $this->source); })()), "getPriceContext", [], "method", false, false, false, 7);
  58. }
  59. // line 9
  60. yield "<div class=\"block header-block block-cart\">
  61. <a class=\"cart-block\" href=\"";
  62. // line 11
  63. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("cart_details");
  64. yield "\">
  65. <span class=\"nb-products ";
  66. // line 12
  67. if (((isset($context["nbProducts"]) || array_key_exists("nbProducts", $context) ? $context["nbProducts"] : (function () { throw new RuntimeError('Variable "nbProducts" does not exist.', 12, $this->source); })()) == 0)) {
  68. yield "hidden";
  69. }
  70. yield "\">";
  71. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["nbProducts"]) || array_key_exists("nbProducts", $context) ? $context["nbProducts"] : (function () { throw new RuntimeError('Variable "nbProducts" does not exist.', 12, $this->source); })()), "html", null, true);
  72. yield "</span>
  73. <img src=\"";
  74. // line 13
  75. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/cart.svg"), "html", null, true);
  76. yield "\" alt=\"";
  77. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Mon panier", [], "messages");
  78. yield "\" width=\"30\" height=\"30\">
  79. </a>
  80. <div class=\"cart-content\">
  81. ";
  82. // line 17
  83. if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["cart"]) || array_key_exists("cart", $context) ? $context["cart"] : (function () { throw new RuntimeError('Variable "cart" does not exist.', 17, $this->source); })()), "items", [], "any", false, false, false, 17)) > 0)) {
  84. // line 18
  85. yield " <div class=\"items scroll-pane\">
  86. <ul>
  87. ";
  88. // line 20
  89. $context['_parent'] = $context;
  90. $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["cart"]) || array_key_exists("cart", $context) ? $context["cart"] : (function () { throw new RuntimeError('Variable "cart" does not exist.', 20, $this->source); })()), "getItems", [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.', 20, $this->source); })()), "request", [], "any", false, false, false, 20), "get", ["_locale"], "method", false, false, false, 20)], "method", false, false, false, 20));
  91. $context['loop'] = [
  92. 'parent' => $context['_parent'],
  93. 'index0' => 0,
  94. 'index' => 1,
  95. 'first' => true,
  96. ];
  97. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  98. $length = count($context['_seq']);
  99. $context['loop']['revindex0'] = $length - 1;
  100. $context['loop']['revindex'] = $length;
  101. $context['loop']['length'] = $length;
  102. $context['loop']['last'] = 1 === $length;
  103. }
  104. foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  105. // line 21
  106. yield " ";
  107. yield from $this->load("front/cart/block-item.html.twig", 21)->unwrap()->yield(CoreExtension::merge($context, ["item" => $context["item"]]));
  108. // line 22
  109. yield " ";
  110. ++$context['loop']['index0'];
  111. ++$context['loop']['index'];
  112. $context['loop']['first'] = false;
  113. if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  114. --$context['loop']['revindex0'];
  115. --$context['loop']['revindex'];
  116. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  117. }
  118. }
  119. $_parent = $context['_parent'];
  120. unset($context['_seq'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
  121. $context = array_intersect_key($context, $_parent) + $_parent;
  122. // line 23
  123. yield " </ul>
  124. </div>
  125. <div class=\"added\"></div>
  126. <a href=\"";
  127. // line 26
  128. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("cart_details");
  129. yield "\" class=\"bt-order\">Voir mon panier</a>
  130. ";
  131. } else {
  132. // line 28
  133. yield " <div class=\"empty\">
  134. Votre panier est vide.
  135. </div>
  136. ";
  137. }
  138. // line 32
  139. yield " </div>
  140. </div>
  141. ";
  142. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  143. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  144. yield from [];
  145. }
  146. /**
  147. * @codeCoverageIgnore
  148. */
  149. public function getTemplateName(): string
  150. {
  151. return "front/cart/block.html.twig";
  152. }
  153. /**
  154. * @codeCoverageIgnore
  155. */
  156. public function isTraitable(): bool
  157. {
  158. return false;
  159. }
  160. /**
  161. * @codeCoverageIgnore
  162. */
  163. public function getDebugInfo(): array
  164. {
  165. return array ( 150 => 32, 144 => 28, 139 => 26, 134 => 23, 120 => 22, 117 => 21, 100 => 20, 96 => 18, 94 => 17, 85 => 13, 77 => 12, 73 => 11, 69 => 9, 65 => 7, 63 => 6, 56 => 4, 52 => 3, 50 => 2, 48 => 1,);
  166. }
  167. public function getSourceContext(): Source
  168. {
  169. return new Source("{% set nbProducts = 0 %}
  170. {% set cart = cartMgr.getCart() %}
  171. {% for item in cart.items %}
  172. {% set nbProducts = nbProducts+item.quantity %}
  173. {% endfor %}
  174. {% if priceGroup is not defined %}
  175. {% set priceGroup = customerMgr.getPriceContext() %}
  176. {% endif %}
  177. <div class=\"block header-block block-cart\">
  178. <a class=\"cart-block\" href=\"{{ path('cart_details') }}\">
  179. <span class=\"nb-products {% if nbProducts == 0 %}hidden{% endif %}\">{{ nbProducts }}</span>
  180. <img src=\"{{ asset('img/cart.svg') }}\" alt=\"{% trans %}Mon panier{% endtrans %}\" width=\"30\" height=\"30\">
  181. </a>
  182. <div class=\"cart-content\">
  183. {% if cart.items|length > 0 %}
  184. <div class=\"items scroll-pane\">
  185. <ul>
  186. {% for item in cart.getItems(app.request.get('_locale')) %}
  187. {% include 'front/cart/block-item.html.twig' with {item:item} %}
  188. {% endfor %}
  189. </ul>
  190. </div>
  191. <div class=\"added\"></div>
  192. <a href=\"{{ path('cart_details') }}\" class=\"bt-order\">Voir mon panier</a>
  193. {% else %}
  194. <div class=\"empty\">
  195. Votre panier est vide.
  196. </div>
  197. {% endif %}
  198. </div>
  199. </div>
  200. ", "front/cart/block.html.twig", "/var/www/dogcat.com/v2-test/templates/front/cart/block.html.twig");
  201. }
  202. }