src/Eccube/Resource/template/default/Block/cart.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% set Carts = get_all_carts() %}
  9. {% set totalPrice = get_carts_total_price() %}
  10. {% set totalQuantity = get_carts_total_quantity() %}
  11. <div class="ec-cartNaviWrap">
  12.     <div class="ec-cartNavi">
  13.         <i class="ec-cartNavi__icon fas fa-shopping-cart">
  14.             <span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span>
  15.         </i>
  16.         <div class="ec-cartNavi__label">
  17.             <div class="ec-cartNavi__price">{{ totalPrice|price }}</div>
  18.         </div>
  19.     </div>
  20.     {% if totalQuantity > 0 %}
  21.         <div class="ec-cartNaviIsset">
  22.             {% for Cart in Carts %}
  23.                 {% for CartItem in Cart.CartItems %}
  24.                     {% set ProductClass = CartItem.ProductClass %}
  25.                     {% set Product = ProductClass.Product %}
  26.                     <div class="ec-cartNaviIsset__cart">
  27.                         <div class="ec-cartNaviIsset__cartImage">
  28.                             <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  29.                         </div>
  30.                         <div class="ec-cartNaviIsset__cartContent">
  31.                             <div class="ec-cartNaviIsset__cartContentTitle">{{ Product.name }}
  32.                                 <div class="ec-font-size-1">
  33.                                     {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  34.                                         {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  35.                                     {% endif %}
  36.                                     {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  37.                                         <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  38.                                     {% endif %}
  39.                                 </div>
  40.                             </div>
  41.                             <div class="ec-cartNaviIsset__cartContentPrice">
  42.                                 {{ CartItem.price|price }}
  43.                                 <div class="ec-cartNaviIsset__cartContentTax">{{ '税込'|trans }}</div>
  44.                             </div>
  45.                             <div class="ec-cartNaviIsset__cartContentNumber">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>
  46.                         </div>
  47.                     </div>
  48.                 {% endfor %}
  49.             {% endfor %}
  50.             <div class="ec-cartNaviIsset__action">
  51.                 <a class="ec-blockBtn--action" href="{{ url('cart') }}">{{ 'カートへ進む'|trans }}</a>
  52.                 <a class="ec-blockBtn ec-cartNavi--cancel">{{ 'キャンセル'|trans }}</a>
  53.             </div>
  54.         </div>
  55.     {% else %}
  56.         <div class="ec-cartNaviNull">
  57.             <div class="ec-cartNaviNull__message">
  58.                 <p>{{ '現在カート内に商品はございません。'|trans }}</p>
  59.             </div>
  60.         </div>
  61.     {% endif %}
  62. </div>