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.     {% 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>