var/cache/dev/twig/fc/fc22bbe388ac018f22f5e43bf96d61e4.php line 46

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