custom/static-plugins/NdVoorwindenTheme/src/Resources/views/storefront/layout/header/actions/cart-widget.html.twig line 1

Open in your IDE?
  1. {% block layout_header_actions_cart_widget %}
  2.     <div class="flex relative">
  3.         <span class="header-cart-icon p-2">
  4.             {% sw_icon 'cart' style{'pack': 'theme-icons', 'class': 'w-6 h-6'} %}
  5.         </span>
  6.         {% if page.cart.lineItems|length > 0 %}
  7.             {% set cartCount = 0 %}
  8.             {% for lineItem in page.cart.lineItems %}
  9.                 {% if lineItem.type == 'product' %}
  10.                     {% set cartCount = cartCount + lineItem.quantity %}
  11.                 {% endif %}
  12.             {% endfor %}
  13.             <span class="text-xs absolute w-4 h-4 text-center top-0 right-0 font-bold text-black bg-white rounded-full">{{ cartCount }}</span>
  14.         {% endif %}
  15.     </div>
  16. {% endblock %}