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. {% if BaseInfo.option_favorite_product %}
  9.     <div class="ec-headerNav__item">
  10.         <a href="{{ url('mypage_favorite') }}">
  11.             <svg xmlns="http://www.w3.org/2000/svg" width="21.5" height="20.6" viewBox="0 0 21.5 20.6"><path d="M4.6 20.6c-.1 0-.2 0-.3-.1-.2-.1-.2-.3-.2-.5l1-6.8-5-4.7c-.1-.1-.1-.3-.1-.5.1-.2.2-.3.4-.3l6.8-1.1 2.9-6.2c.1-.3.3-.4.5-.4s.4.1.5.3l3.2 6.1 6.7.9c.2 0 .3.2.4.3.1.2 0 .4-.1.5l-4.8 4.9 1.3 6.8c0 .2 0 .4-.2.5-.2.1-.4.1-.5 0l-6.2-3.1-6 3.3c-.1.1-.2.1-.3.1zm-3-12.2l4.4 4.3c.1.1.2.3.2.4l-.9 6.1 5.4-3c.1-.1.3-.1.5 0l5.5 2.8-1.1-6c0-.2 0-.3.1-.4l4.3-4.4-6.1-.8c-.2 0-.3-.1-.4-.3l-2.8-5.5-2.7 5.6c-.1.1-.2.2-.4.3l-6 .9z"/></svg>
  12.             <span class="header_ico_text">{{ 'お気に入り'|trans }}</span>
  13.         </a>
  14.     </div>
  15. {% endif %}
  16. {% set Carts = get_all_carts() %}
  17. {% set totalPrice = get_carts_total_price() %}
  18. <div class="ec-cartNaviWrap">
  19.     <div class="ec-cartNavi head_cartNavi">
  20.         <svg xmlns="http://www.w3.org/2000/svg" width="21.5" height="20.6" viewBox="0 0 21.5 20.6"><path d="M18.4 16.7h-10.8c-.2 0-.5-.2-.5-.4l-2.5-14.5h-3.1c-.3 0-.5-.3-.5-.5s.2-.5.5-.5h3.6c.2 0 .5.2.5.4l2.4 14.5h10.4c.3 0 .5.2.5.5s-.2.5-.5.5zm.5-3.3h-11.9c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h11.5l1.3-7.6h-14.2c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h14.8c.1 0 .3.1.4.2.1.1.1.3.1.4l-1.5 8.6c0 .2-.2.4-.5.4zm.8-4.3h-13.4c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h13.4c.3 0 .5.2.5.5s-.3.5-.5.5zm-4.4 4.3c-.3 0-.5-.2-.5-.5v-8.6c0-.3.2-.5.5-.5s.5.2.5.5v8.6c0 .3-.2.5-.5.5zm-4.7 0c-.3 0-.5-.2-.5-.5v-8.6c0-.3.2-.5.5-.5s.5.2.5.5v8.6c0 .3-.2.5-.5.5zm-2.2 7c-.6 0-1-.5-1-1s.5-1 1-1 1 .5 1 1-.4 1-1 1zm0-1zm9 1c-.6 0-1-.5-1-1s.5-1 1-1 1 .5 1 1-.5 1-1 1zm0-1z"/></svg>
  21.         <span class="header_ico_text">カート</span>
  22.         {% set totalQuantity = get_carts_total_quantity() %}
  23.         <span class="ec-cartNavi__badge" id="head_cartNavi_badge">{{ totalQuantity|number_format }}</span>
  24.     </div>
  25.     {% if totalQuantity > 0 %}
  26.         <div class="ec-cartNaviIsset">
  27.             <div class="ec-cartNaviIsset_inner">
  28.                 {% for Cart in Carts %}
  29.                     {% for CartItem in Cart.CartItems %}
  30.                         {% set ProductClass = CartItem.ProductClass %}
  31.                         {% set Product = ProductClass.Product %}
  32.                         <div class="ec-cartNaviIsset__cart">
  33.                             <div class="ec-cartNaviIsset__cartImage">
  34.                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  35.                             </div>
  36.                             <div class="ec-cartNaviIsset__cartContent">
  37.                                 <div class="ec-cartNaviIsset__cartContentTitle item_name">{{ Product.name }}
  38.                                     <div class="ec-font-size-1">
  39.                                         {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  40.                                             {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  41.                                         {% endif %}
  42.                                         {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  43.                                             <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  44.                                         {% endif %}
  45.                                     </div>
  46.                                 </div>
  47.                                 <div class="ec-cartNaviIsset__cartContentPrice customer_rank_price_default mb0">
  48.                                     {{ CartItem.price|price }}
  49.                                     <div class="ec-cartNaviIsset__cartContentTax ec-price__tax f11">{{ '税込'|trans }}</div>
  50.                                 </div>
  51.                                 <div class="ec-cartNaviIsset__cartContentNumber">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>
  52.                                 <div class="cartNaviIsset_del">
  53.                                     <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-inlineBtn" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
  54.                                         ×削除
  55.                                     </a>
  56.                                 </div>
  57.                             </div>
  58.                         </div>
  59.                     {% endfor %}
  60.                 {% endfor %}
  61.             </div>
  62.             <div class="ec-cartNavi__label">
  63.                 <div class="ec-cartNavi__price fw fs_ml text-center mt01 mb01">合計:<span class="red">{{ totalPrice|price }}</span></div>
  64.             </div>
  65.             <div class="ec-cartNaviIsset__action">
  66.                 <a class="ec-blockBtn--action" href="{{ url('cart') }}">{{ 'カートへ進む'|trans }}</a>
  67.                 <a class="ec-blockBtn ec-cartNavi--cancel">{{ 'キャンセル'|trans }}</a>
  68.             </div>
  69.         </div>
  70.     {% else %}
  71.         <div class="ec-cartNaviNull">
  72.             <div class="ec-cartNaviNull__message">
  73.                 <p>現在カート内に<span class="ib">商品はございません</span></p>
  74.                 <a class="ec-blockBtn ec-cartNavi--cancel mt01">{{ 'キャンセル'|trans }}</a>
  75.             </div>
  76.         </div>
  77.     {% endif %}
  78. </div>