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