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