templates/front/cart/block.html.twig line 2

Open in your IDE?
  1. {% set nbProducts = 0 %}
  2. {% set cart = cartMgr.getCart() %}
  3. {% for item in cart.items %}
  4. {% set nbProducts = nbProducts+item.quantity %}
  5. {% endfor %}
  6. {% if priceGroup is not defined %}
  7. {% set priceGroup = customerMgr.getPriceContext() %}
  8. {% endif %}
  9. <div class="block header-block block-cart">
  10. <a class="cart-block" href="{{ path('cart_details') }}">
  11. <span class="nb-products {% if nbProducts == 0 %}hidden{% endif %}">{{ nbProducts }}</span>
  12. <img src="{{ asset('img/cart.svg') }}" alt="{% trans %}Mon panier{% endtrans %}" width="30" height="30">
  13. </a>
  14. <div class="cart-content">
  15. {% if cart.items|length > 0 %}
  16. <div class="items scroll-pane">
  17. <ul>
  18. {% for item in cart.getItems(app.request.get('_locale')) %}
  19. {% include 'front/cart/block-item.html.twig' with {item:item} %}
  20. {% endfor %}
  21. </ul>
  22. </div>
  23. <div class="added"></div>
  24. <a href="{{ path('cart_details') }}" class="bt-order">Voir mon panier</a>
  25. {% else %}
  26. <div class="empty">
  27. Votre panier est vide.
  28. </div>
  29. {% endif %}
  30. </div>
  31. </div>