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