templates/app/_inc/_cart.html.twig line 1

Open in your IDE?
  1. {% import 'app/_inc/macros.html.twig' as m %}
  2. {% if cartProducts|length > 0 %}
  3.     {% set nbr = cartProducts|length %}
  4. {% else %}
  5.     {% set nbr = 0 %}
  6. {% endif %}
  7. <div class="icon-access" title="{{ 'Cart'|trans|raw }}">
  8.     {% if nbr>0 %}
  9.         <div class="dot"></div>
  10.     {% endif %}
  11.     {{ m.svg('icon/cart') }}
  12.     <div class="sub-wrap">
  13.         {#        <div class="close_cart">{{ m.icon("cross") }}</div> #}
  14.         <p class="h4">{{ 'Cart' }}</p>
  15.         {% if cartProducts|length > 0 %}
  16.         {% else %}
  17.             <p>{{ 'Your cart is empty...'|trans|raw }}</p>
  18.         {% endif %}
  19.         <ul>
  20.             {% set total = 0 %}
  21.             {% for p in cartProducts %}
  22.                 <li class="product">
  23.                     {% if p.product.translate.title == 'Tome' %}
  24.                         {{ m.svg('icon/icons-ollam/favi-tome-light', 'all.site') }}
  25.                     {% elseif p.product.translate.title == 'Lore' %}
  26.                         {{ m.svg('icon/icons-ollam/favi-lore-light', 'all.site') }}
  27.                     {% else %}
  28.                         {{ m.svg('icon/icons-ollam/amsel_light', 'all.site') }}
  29.                     {% endif %}
  30.                     <div class="product-resume">
  31.                         <p>{{ 'Amsel Suite' }}</p>
  32.                         <span>{{ p.product.translate.title }}</span>
  33.                         <p class="price">{{ p.product.actualPrice|number_format(2, ',', ' ') }}{{ ' €' }}</p>
  34.                     </div>
  35.                     <a class="delete" href="{{ path('remove_to_cart', {id:p.id}) }}">
  36.                         {{ m.icon('trash') }}
  37.                     </a>
  38.                 </li>
  39.                 {% set total = total + (p.quantity * p.product.actualPrice) %}
  40.             {% endfor %}
  41.         </ul>
  42.         <div class="price_summary">
  43.             <p>{{ 'Total (incl. tax)'|trans|raw }}</p>
  44.             <p class="price">{{ total|number_format(2, ',', ' ') }}{{ ' €' }}</p>
  45.         </div>
  46.         {% if cartProducts|length > 0 %}
  47.             {{ m.btn('icons-ollam/contact', 'Checkout', path('preorder', {id:1}), {class:'btn btn-cta-secondary'}) }}
  48.         {% endif %}
  49.     </div>
  50. </div>