app/template/default/Block/cart.twig line 1

Open in your IDE?
  1. {% set Carts = get_all_carts() %}
  2. {% set totalPrice = get_carts_total_price() %}
  3. {% set totalQuantity = get_carts_total_quantity() %}
  4. <div class="ec-headerRole__cart">
  5.     <div class="ec-cartNaviWrap">
  6.         <div class="ec-cartNavi">
  7.             <div class="header-btn-cart">
  8.                 <span class="cart_number">{{ totalQuantity|number_format }}</span>
  9.                 <img class="img_cart" loading="lazy" src="{{ asset('assets/img/common/icon-cart.png','user_data') }}" alt="cart image" />
  10.             </div>
  11.         </div>
  12.         {% if totalQuantity > 0 %}
  13.             <div class="ec-cartNaviIsset">
  14.                 {% for Cart in Carts %}
  15.                     {% for CartItem in Cart.CartItems %}
  16.                         {% set ProductClass = CartItem.ProductClass %}
  17.                         {% set Product = ProductClass.Product %}
  18.                         <div class="ec-cartNaviIsset__cart">
  19.                             <div class="ec-cartNaviIsset__cartImage">
  20.                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  21.                             </div>
  22.                             <div class="ec-cartNaviIsset__cartContent">
  23.                                 <div class="ec-cartNaviIsset__cartContentTitle">{{ Product.name }}
  24.                                     <div class="ec-font-size-1">
  25.                                         {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  26.                                             {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  27.                                         {% endif %}
  28.                                         {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  29.                                             <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  30.                                         {% endif %}
  31.                                     </div>
  32.                                 </div>
  33.                                 <div class="ec-cartNaviIsset__cartContentPrice">
  34.                                     {{ CartItem.price|price }}
  35.                                     <div class="ec-cartNaviIsset__cartContentTax">{{ '税込'|trans }}</div>
  36.                                 </div>
  37.                                 <div class="ec-cartNaviIsset__cartContentNumber">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>
  38.                             </div>
  39.                         </div>
  40.                     {% endfor %}
  41.                 {% endfor %}
  42.                 <div class="ec-cartNaviIsset__action">
  43.                     <a class="ec-blockBtn--action" href="{{ url('cart') }}">{{ 'カートへ進む'|trans }}</a>
  44.                     <a class="ec-blockBtn ec-cartNavi--cancel">{{ 'キャンセル'|trans }}</a>
  45.                 </div>
  46.             </div>
  47.         {% else %}
  48.             <div class="ec-cartNaviNull">
  49.                 <div class="ec-cartNaviNull__message">
  50.                     <p>{{ '現在カート内に商品はございません。'|trans }}</p>
  51.                 </div>
  52.             </div>
  53.         {% endif %}
  54.     </div>
  55. </div>