vendor/coreshop/core-shop/src/CoreShop/Bundle/FrontendBundle/Resources/views/Cart/_widget.html.twig line 1

Open in your IDE?
  1. {% import '@CoreShopFrontend/Common/Macro/currency.html.twig' as currency %}
  2. <div id="cart" class="btn-group btn-block">
  3.     <button type="button" class="btn btn-block btn-lg dropdown-toggle" data-toggle="dropdown">
  4.         <i class="fa fa-shopping-cart"></i>
  5.         <span id="cart-overview-total">
  6.             <span class="cart-badge">{% if cart.items %} {{ cart.items|length }} {% else %} 0 {% endif %}</span> {{ 'coreshop.ui.items'|trans }} -
  7.             <span class="cart-total"  {{ coreshop_test_html_attribute('cart-total') }}> {{ currency.convertAndFormat(cart.total) }}</span>
  8.         </span>
  9.     </button>
  10.     <ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenuButton">
  11.         <li>
  12.             {% if cart.hasItems %}
  13.             <table class="table hcart cart-items">
  14.                 {% for item in cart.items %}
  15.                     <tr>
  16.                         <td class="text-center">
  17.                             {% if item.product %}
  18.                             <a href="{{ pimcore_object_path(item.product) }}">
  19.                                 {% if item.product and item.product.image is pimcore_asset_image %}
  20.                                     {{ item.product.image|pimcore_image_thumbnail_html('coreshop_productCartPreview', {'imgAttributes': {'class': 'img-thumbnail img-fluid'}, 'title': item.product.name, 'alt': item.product.name}) }}
  21.                                 {% endif %}
  22.                             </a>
  23.                             {% endif %}
  24.                         </td>
  25.                         <td class="text-left">
  26.                             {% if item.product %}
  27.                             <a href="{{ pimcore_object_path(item.product) }}">
  28.                                 {{ item.product.name }}
  29.                             </a>
  30.                             {% endif %}
  31.                         </td>
  32.                         <td class="text-right">x {{ item.quantity }}</td>
  33.                         <td class="text-right">{{ currency.convertAndFormat(item.total) }}</td>
  34.                         <td class="text-center">
  35.                             {% if not item.isGiftItem %}
  36.                                 <a href="{{ path('coreshop_cart_remove', {cartItem: item.id}) }}" class="removeFromCart" data-id="{{ item.id }}" data-refresh="true">
  37.                                     <i class="fa fa-times"></i>
  38.                                 </a>
  39.                             {% endif %}
  40.                         </td>
  41.                     </tr>
  42.                 {% endfor %}
  43.             </table>
  44.             {% endif %}
  45.         </li>
  46.         <li>
  47.             <table class="table table-bordered total">
  48.                 <tbody>
  49.                 <tr>
  50.                     <td class="text-right"><strong>{{ 'coreshop.ui.subtotal'|trans }}</strong></td>
  51.                     <td class="text-left cart-subtotal">{{ currency.convertAndFormat(cart.subtotal) }}</td>
  52.                 </tr>
  53.                 <tr>
  54.                     <td class="text-right"><strong>{{ 'coreshop.ui.total'|trans }}</strong></td>
  55.                     <td class="text-left cart-total">{{ currency.convertAndFormat(cart.total) }}</td>
  56.                 </tr>
  57.                 </tbody>
  58.             </table>
  59.             <p class="text-right btn-block1">
  60.                 {% if is_granted('CORESHOP_CART_SUMMARY') %}
  61.                     <a href="{{ path('coreshop_cart_summary') }}">
  62.                         {{ 'coreshop.ui.cart'|trans }}
  63.                     </a>
  64.                 {% endif %}
  65.                 {% if is_granted('CORESHOP_CHECKOUT') %}
  66.                     <a href="{{ path('coreshop_checkout', {'stepIdentifier': coreshop_checkout_steps_get_first()}) }}">
  67.                         {{ 'coreshop.ui.checkout'|trans }}
  68.                     </a>
  69.                 {% endif %}
  70.             </p>
  71.         </li>
  72.     </ul>
  73. </div>