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. {% block stylesheet %}
  12.     <style>
  13.         @media screen and (min-width: 768px) and (max-width: 1168px) {  
  14.             .ec-cartNaviIsset__action .ec-blockBtn--action {
  15.                 max-width: 224px;
  16.             }
  17.         }
  18.     </style>
  19. {% endblock %}
  20. <div class="ec-cartNaviWrap">
  21.     <div class="ec-cartNavi">
  22.         <i class="ec-cartNavi__icon fas fa-shopping-cart">
  23.             <span class="ec-cartNavi__badge">{{ totalQuantity|number_format }}</span>
  24.         </i>
  25.         <div class="ec-cartNavi__label">
  26.             <div class="ec-cartNavi__price">{{ totalPrice|price }}</div>
  27.         </div>
  28.     </div>
  29.     {% if totalQuantity > 0 %}
  30.         <div class="ec-cartNaviIsset">
  31.             {% for Cart in Carts %}
  32.                 {% for CartItem in Cart.CartItems %}
  33.                     {% set ProductClass = CartItem.ProductClass %}
  34.                     {% set Product = ProductClass.Product %}
  35.                     <div class="ec-cartNaviIsset__cart">
  36.                         <div class="ec-cartNaviIsset__cartImage">
  37.                             <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  38.                         </div>
  39.                         <div class="ec-cartNaviIsset__cartContent">
  40.                             <div class="ec-cartNaviIsset__cartContentTitle">{{ Product.name }}
  41.                                 <div class="ec-font-size-1">
  42.                                     {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  43.                                         {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  44.                                     {% endif %}
  45.                                     {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  46.                                         <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  47.                                     {% endif %}
  48.                                 </div>
  49.                             </div>
  50.                             <div class="ec-cartNaviIsset__cartContentPrice">
  51.                                 {{ CartItem.price|price }}
  52.                                 <div class="ec-cartNaviIsset__cartContentTax">{{ '税込'|trans }}</div>
  53.                             </div>
  54.                             <div class="ec-cartNaviIsset__cartContentNumber">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>
  55.                         </div>
  56.                     </div>
  57.                 {% endfor %}
  58.             {% endfor %}
  59.             <div class="ec-cartNaviIsset__action">
  60.                 <a class="ec-blockBtn--action" href="{{ url('cart') }}">{{ 'カートへ進む'|trans }}</a>
  61.                 <a class="ec-blockBtn ec-cartNavi--cancel">{{ 'キャンセル'|trans }}</a>
  62.             </div>
  63.         </div>
  64.     {% else %}
  65.         <div class="ec-cartNaviNull">
  66.             <div class="ec-cartNaviNull__message">
  67.                 <p>{{ '現在カート内に商品はございません。'|trans }}</p>
  68.             </div>
  69.         </div>
  70.     {% endif %}
  71. </div>