<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* front/cart/block.html.twig */
class __TwigTemplate_8cf7b77d2a2738ceefefdf43462d1331 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/cart/block.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/cart/block.html.twig"));
// line 1
$context["nbProducts"] = 0;
// line 2
$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);
// line 3
$context['_parent'] = $context;
$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));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 4
yield " ";
$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));
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 6
if ( !array_key_exists("priceGroup", $context)) {
// line 7
yield " ";
$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);
}
// line 9
yield "<div class=\"block header-block block-cart\">
<a class=\"cart-block\" href=\"";
// line 11
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("cart_details");
yield "\">
<span class=\"nb-products ";
// line 12
if (((isset($context["nbProducts"]) || array_key_exists("nbProducts", $context) ? $context["nbProducts"] : (function () { throw new RuntimeError('Variable "nbProducts" does not exist.', 12, $this->source); })()) == 0)) {
yield "hidden";
}
yield "\">";
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);
yield "</span>
<img src=\"";
// line 13
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/cart.svg"), "html", null, true);
yield "\" alt=\"";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Mon panier", [], "messages");
yield "\" width=\"30\" height=\"30\">
</a>
<div class=\"cart-content\">
";
// line 17
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)) {
// line 18
yield " <div class=\"items scroll-pane\">
<ul>
";
// line 20
$context['_parent'] = $context;
$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));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 21
yield " ";
yield from $this->loadTemplate("front/cart/block-item.html.twig", "front/cart/block.html.twig", 21)->unwrap()->yield(CoreExtension::merge($context, ["item" => $context["item"]]));
// line 22
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 23
yield " </ul>
</div>
<div class=\"added\"></div>
<a href=\"";
// line 26
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("cart_details");
yield "\" class=\"bt-order\">Voir mon panier</a>
";
} else {
// line 28
yield " <div class=\"empty\">
Votre panier est vide.
</div>
";
}
// line 32
yield " </div>
</div>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "front/cart/block.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% set nbProducts = 0 %}
{% set cart = cartMgr.getCart() %}
{% for item in cart.items %}
{% set nbProducts = nbProducts+item.quantity %}
{% endfor %}
{% if priceGroup is not defined %}
{% set priceGroup = customerMgr.getPriceContext() %}
{% endif %}
<div class=\"block header-block block-cart\">
<a class=\"cart-block\" href=\"{{ path('cart_details') }}\">
<span class=\"nb-products {% if nbProducts == 0 %}hidden{% endif %}\">{{ nbProducts }}</span>
<img src=\"{{ asset('img/cart.svg') }}\" alt=\"{% trans %}Mon panier{% endtrans %}\" width=\"30\" height=\"30\">
</a>
<div class=\"cart-content\">
{% if cart.items|length > 0 %}
<div class=\"items scroll-pane\">
<ul>
{% for item in cart.getItems(app.request.get('_locale')) %}
{% include 'front/cart/block-item.html.twig' with {item:item} %}
{% endfor %}
</ul>
</div>
<div class=\"added\"></div>
<a href=\"{{ path('cart_details') }}\" class=\"bt-order\">Voir mon panier</a>
{% else %}
<div class=\"empty\">
Votre panier est vide.
</div>
{% endif %}
</div>
</div>
", "front/cart/block.html.twig", "/var/www/dogcat.com/v2-test/templates/front/cart/block.html.twig");
}
}