app/template/default/Cart/index.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. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'cart_page' %}
  10. {% block main %}
  11. <section class="l-lower-heading">
  12.   <h1 class="l-lower-heading__title">{{ 'ショッピングカート'|trans }}</h1>
  13. </section>
  14. <section class="cart">
  15.   <div class="inner cart__inner">
  16.     <div class="l-breadcrumb">
  17.       <ul itemscope itemtype="https://schema.org/BreadcrumbList" class="l-breadcrumb__list">
  18.         <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="l-breadcrumb__item">
  19.           <a itemprop="item" href="{{ url('homepage') }}" class="l-breadcrumb__link">
  20.             <span class="freight-neo-pro" itemprop="name">TOP</span>
  21.           </a>
  22.           <meta itemprop="position" content="1" />
  23.         </li>
  24.         <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="l-breadcrumb__item">
  25.           <a itemprop="item" class="l-breadcrumb__link">
  26.             <span class="freight-neo-pro" itemprop="name">カート</span>
  27.           </a>
  28.           <meta itemprop="position" content="2" />
  29.         </li>
  30.       </ul>
  31.     </div>
  32.     <div class="cart__container">
  33.       <ul class="ec-progress">
  34.         {% set step = 1 %}
  35.         <li class="ec-progress__item is-complete">
  36.           <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  37.           </div>
  38.           <div class="ec-progress__label">{{ 'カートの<br>商品'|trans|raw }}
  39.           </div>
  40.         </li>
  41.         {% if is_granted('ROLE_USER') == false %}
  42.         <li class="ec-progress__item">
  43.           <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  44.           </div>
  45.           <div class="ec-progress__label">{{ 'お客様<br>情報'|trans|raw }}
  46.           </div>
  47.         </li>
  48.         {% endif %}
  49.         <li class="ec-progress__item">
  50.           <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  51.           </div>
  52.           <div class="ec-progress__label">{{ 'ご注文<br>手続き'|trans|raw }}
  53.           </div>
  54.         </li>
  55.         <li class="ec-progress__item">
  56.           <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  57.           </div>
  58.           <div class="ec-progress__label">{{ 'ご注文<br>内容確認'|trans|raw }}
  59.           </div>
  60.         </li>
  61.         <li class="ec-progress__item">
  62.           <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  63.           </div>
  64.           <div class="ec-progress__label">{{ '完了'|trans }}
  65.           </div>
  66.         </li>
  67.       </ul>
  68.       {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  69.       {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  70.       {% set idx = loop.index0 %}
  71.         <div class="ec-alert-warning">
  72.           <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation.svg') }}"></div>
  73.           <div class="ec-alert-warning__text">
  74.             {% if productStr[idx] is defined %}
  75.             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  76.             {% else %}
  77.             {{ error|trans|nl2br }}
  78.             {% endif %}
  79.           </div>
  80.         </div>
  81.       {% endfor %}
  82.       {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  83.         <div class="ec-alert-warning">
  84.           <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation.svg') }}"></div>
  85.           <div class="ec-alert-warning__text">
  86.             {{ error|trans|nl2br }}
  87.           </div>
  88.         </div>
  89.       {% endfor %}
  90.       {% if totalQuantity > 0 %}
  91.       <p class="cart__text">
  92.         {{ '商品の合計金額は「%price%」です。'|trans({ '%price%': totalPrice|price })|raw }}
  93.       </p>
  94.       {% if Carts|length > 1 %}
  95.         <div class="ec-alert-warning">
  96.           <div class="ec-alert-warning__text">
  97.             {{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
  98.           </div>
  99.         </div>
  100.       {% endif %}
  101.       <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  102.         {% for CartIndex,Cart in Carts %}
  103.         {% set cartKey = Cart.cart_key %}
  104.         {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  105.           <div class="ec-alert-warning">
  106.             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation.svg') }}"></div>
  107.             <div class="ec-alert-warning__text">
  108.               {{ error|trans|nl2br }}
  109.             </div>
  110.           </div>
  111.         {% endfor %}
  112.         <p class="cart__text">
  113.           {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  114.           {% if is_delivery_free[cartKey] %}
  115.           {{ '現在送料無料です。'|trans }}
  116.           {% else %}
  117.           {{ 'あと「%price%」または「%quantity%個」以上のご購入で送料無料となります。'|trans({ '%price%': least[cartKey]|price, '%quantity%':
  118.           quantity[cartKey]|number_format })|raw }}
  119.           {% endif %}
  120.           {% elseif BaseInfo.delivery_free_amount %}
  121.           {% if is_delivery_free[cartKey] %}
  122.           {{ '現在送料無料です。'|trans }}
  123.           {% else %}
  124.           {{ 'あと「%price%」以上のご購入で送料無料となります。'|trans({ '%price%':
  125.           least[cartKey]|price })|raw }}
  126.           {% endif %}
  127.           {% elseif BaseInfo.delivery_free_quantity %}
  128.           {% if is_delivery_free[cartKey] %}
  129.           {{ '現在送料無料です。'|trans }}
  130.           {% else %}
  131.           {{ 'あと「%quantity%個」以上のご購入で送料無料となります。'|trans({
  132.           '%quantity%':
  133.           quantity[cartKey]|number_format })|raw }}
  134.           {% endif %}
  135.           {% endif %}
  136.         </p>
  137.         <div class="ec-cartRole__cart">
  138.           <div class="ec-cartTable">
  139.             <ol class="ec-cartHeader">
  140.               <li class="ec-cartHeader__label">{{ '削除'|trans }}</li>
  141.               <li class="ec-cartHeader__label">{{ '商品内容'|trans }}</li>
  142.               <li class="ec-cartHeader__label">{{ '数量'|trans }}</li>
  143.               <li class="ec-cartHeader__label">{{ '小計(税込)'|trans }}</li>
  144.             </ol>
  145.             {% for CartItem in Cart.CartItems %}
  146.             {% set ProductClass = CartItem.ProductClass %}
  147.             {% set Product = ProductClass.Product %}
  148.             <ul class="ec-cartRow">
  149.               <li class="ec-cartRow__delColumn">
  150.                 <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{
  151.                   csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
  152.                   <img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
  153.                 </a>
  154.               </li>
  155.               <li class="ec-cartRow__contentColumn">
  156.                 <div class="ec-cartRow__img">
  157.                   <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  158.                     <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}"
  159.                       alt="{{ Product.name }}" />
  160.                   </a>
  161.                 </div>
  162.                 <div class="ec-cartRow__summary">
  163.                   <div class="ec-cartRow__name">
  164.                     <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  165.                     {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  166.                     <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  167.                     {% endif %}
  168.                     {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  169.                     <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  170.                     {% endif %}
  171.                   </div>
  172.                   <div class="ec-cartRow__text">出荷より3~7日以内に到着予定</div>
  173.                   <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }}</div>
  174.                   <div class="ec-cartRow__sutbtotalSP">{{ '小計:'|trans }}{{ CartItem.total_price|price }}</div>
  175.                 </div>
  176.               </li>
  177.               <li class="ec-cartRow__amountColumn">
  178.                 <div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
  179.                 <div class="ec-cartRow__amountSP">{{ '数量:'|trans }}{{ CartItem.quantity|number_format }}</div>
  180.                 <div class="ec-cartRow__amountUpDown">
  181.                   {% if CartItem.quantity > 1 %}
  182.                   <a href="{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}" {{
  183.                     csrf_token_for_anchor() }} class="ec-cartRow__amountDownButton load-overlay" data-method="put"
  184.                     data-confirm="false">
  185.                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus-dark.svg') }}"
  186.                         alt="reduce"></span>
  187.                   </a>
  188.                   {% else %}
  189.                   <div class="ec-cartRow__amountDownButtonDisabled">
  190.                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus.svg') }}"
  191.                         alt="reduce"></span>
  192.                   </div>
  193.                   {% endif %}
  194.                   <a href="{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}" {{
  195.                     csrf_token_for_anchor() }} class="ec-cartRow__amountUpButton load-overlay" data-method="put"
  196.                     data-confirm="false">
  197.                     <span class="ec-cartRow__amountUpButton__icon"><img src="{{ asset('assets/icon/plus-dark.svg') }}"
  198.                         alt="increase"></span>
  199.                   </a>
  200.                 </div>
  201.               </li>
  202.               <li class="ec-cartRow__subtotalColumn">
  203.                 <div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
  204.               </li>
  205.             </ul>
  206.             {% endfor %}
  207.           </div>
  208.           <div class="ec-cartRole__actions">
  209.             <div class="ec-cartRole__total">{{ '合計:'|trans }}<span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price
  210.                 }}</span>
  211.             </div>
  212.             <a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">{{ 'レジに進む'|trans }}</a>
  213.             {% if loop.last %}
  214.             <a class="ec-blockBtn--cancel" href="{{ path('homepage') }}">{{ 'お買い物を続ける'|trans }}</a>
  215.             {% endif %}
  216.           </div>
  217.         </div>
  218.         
  219.         {% endfor %}
  220.       </form>
  221.       {% else %}
  222.       {% for CartIndex,Cart in Carts %}
  223.       {% set cartKey = Cart.cart_key %}
  224.       {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  225.         <div class="ec-alert-warning">
  226.           <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation.svg') }}"></div>
  227.           <div class="ec-alert-warning__text">
  228.             {{ error|trans|nl2br }}
  229.           </div>
  230.         </div>
  231.       {% endfor %}
  232.       {% endfor %}
  233.             <div class="ec-alert-warning">
  234.               <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation.svg') }}"></div>
  235.               <div class="ec-alert-warning__text">{{ '現在カート内に商品はございません。'|trans }}</div>
  236.             </div>
  237.       {% endif %}
  238.     </div>
  239.   </div>
  240. </section>
  241. <!-- /.cart -->
  242. {% endblock %}