app/template/kaorime/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.     <div class="ec-role">
  12.         <div class="ec-pageHeader">
  13.             <h1>{{ 'ショッピングカート'|trans }}</h1>
  14.         </div>
  15.     </div>
  16.     <div class="ec-cartRole">
  17.         <div class="ec-cartRole__progress">
  18.             <ul class="ec-progress">
  19.                 {% set step = 1 %}
  20.                 <li class="ec-progress__item is-complete">
  21.                     <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  22.                     </div>
  23.                     <div class="ec-progress__label">{{ 'カートの商品'|trans }}
  24.                     </div>
  25.                 </li>
  26.                 {% if is_granted('ROLE_USER') == false %}
  27.                     <li class="ec-progress__item">
  28.                         <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  29.                         </div>
  30.                         <div class="ec-progress__label">{{ 'お客様情報'|trans }}
  31.                         </div>
  32.                     </li>
  33.                 {% endif %}
  34.                 <li class="ec-progress__item">
  35.                     <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  36.                     </div>
  37.                     <div class="ec-progress__label">{{ 'ご注文手続き'|trans }}
  38.                     </div>
  39.                 </li>
  40.                 <li class="ec-progress__item">
  41.                     <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  42.                     </div>
  43.                     <div class="ec-progress__label">{{ 'ご注文内容確認'|trans }}
  44.                     </div>
  45.                 </li>
  46.                 <li class="ec-progress__item">
  47.                     <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  48.                     </div>
  49.                     <div class="ec-progress__label">{{ '完了'|trans }}
  50.                     </div>
  51.                 </li>
  52.             </ul>
  53.         </div>
  54.         {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  55.         {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  56.             {% set idx = loop.index0 %}
  57.             <div class="ec-cartRole__error">
  58.                 <div class="ec-alert-warning">
  59.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  60.                     <div class="ec-alert-warning__text">
  61.                         {% if productStr[idx] is defined %}
  62.                             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  63.                         {% else %}
  64.                             {{ error|trans|nl2br }}
  65.                         {% endif %}
  66.                     </div>
  67.                 </div>
  68.             </div>
  69.         {% endfor %}
  70.         {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  71.             <div class="ec-cartRole__error">
  72.                 <div class="ec-alert-warning">
  73.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  74.                     <div class="ec-alert-warning__text">
  75.                         {{ error|trans|nl2br }}
  76.                     </div>
  77.                 </div>
  78.             </div>
  79.         {% endfor %}
  80.         {% if totalQuantity > 0 %}
  81.             <div class="ec-cartRole__totalText">
  82.                 <p>
  83.                     {{ '商品の合計金額は「<strong>%price%</strong>」です。'|trans({ '%price%': totalPrice|price })|raw }}
  84.                 </p>
  85.             </div>
  86.             {% if Carts|length > 1 %}
  87.                 <div class="ec-cartRole__error">
  88.                     <div class="ec-alert-warning">
  89.                         <div class="ec-alert-warning__text">
  90.                             {{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
  91.                         </div>
  92.                     </div>
  93.                 </div>
  94.             {% endif %}
  95.             <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  96.                 {% for CartIndex,Cart in Carts %}
  97.                     {% set cartKey = Cart.cart_key %}
  98.                     {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  99.                         <div class="ec-cartRole__error">
  100.                             <div class="ec-alert-warning">
  101.                                 <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  102.                                 <div class="ec-alert-warning__text">
  103.                                     {{ error|trans|nl2br }}
  104.                                 </div>
  105.                             </div>
  106.                         </div>
  107.                     {% endfor %}
  108.                     <div class="ec-cartRole__cart">
  109.                         <div class="ec-cartTable">
  110.                             <ol class="ec-cartHeader">
  111.                                 <li class="ec-cartHeader__label">{{ '削除'|trans }}</li>
  112.                                 <li class="ec-cartHeader__label">{{ '商品内容'|trans }}</li>
  113.                                 <li class="ec-cartHeader__label">{{ '数量'|trans }}</li>
  114.                                 <li class="ec-cartHeader__label">{{ '小計'|trans }}</li>
  115.                             </ol>
  116.                             {% for CartItem in Cart.CartItems %}
  117.                                 {% set ProductClass = CartItem.ProductClass %}
  118.                                 {% set Product = ProductClass.Product %}
  119.                                 <ul class="ec-cartRow">
  120.                                     <li class="ec-cartRow__delColumn">
  121.                                         <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
  122.                                             <img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
  123.                                         </a>
  124.                                     </li>
  125.                                     <li class="ec-cartRow__contentColumn">
  126.                                         <div class="ec-cartRow__img">
  127.                                             <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  128.                                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}"/>
  129.                                             </a>
  130.                                         </div>
  131.                                         <div class="ec-cartRow__summary">
  132.                                             <div class="ec-cartRow__name">
  133.                                                 <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  134.                                                 {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  135.                                                     <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  136.                                                 {% endif %}
  137.                                                 {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  138.                                                     <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  139.                                                 {% endif %}
  140.                                             </div>
  141.                                             <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }}</div>
  142.                                             <div class="ec-cartRow__sutbtotalSP">{{ '小計:'|trans }}{{ CartItem.total_price|price }}</div>
  143.                                         </div>
  144.                                     </li>
  145.                                     <li class="ec-cartRow__amountColumn">
  146.                                         <div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
  147.                                         <div class="ec-cartRow__amountSP">{{ '数量:'|trans }}{{ CartItem.quantity|number_format }}</div>
  148.                                         <div class="ec-cartRow__amountUpDown">
  149.                                             {% if CartItem.quantity > 1 %}
  150.                                                 <a href="{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="ec-cartRow__amountDownButton load-overlay" data-method="put" data-confirm="false">
  151.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus-dark.svg') }}" alt="reduce"></span>
  152.                                                 </a>
  153.                                             {% else %}
  154.                                                 <div class="ec-cartRow__amountDownButtonDisabled">
  155.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus.svg') }}" alt="reduce"></span>
  156.                                                 </div>
  157.                                             {% endif %}
  158.                                             <a href="{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="ec-cartRow__amountUpButton load-overlay" data-method="put" data-confirm="false">
  159.                                                 <span class="ec-cartRow__amountUpButton__icon"><img src="{{ asset('assets/icon/plus-dark.svg') }}" alt="increase"></span>
  160.                                             </a>
  161.                                         </div>
  162.                                     </li>
  163.                                     <li class="ec-cartRow__subtotalColumn">
  164.                                         <div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
  165.                                     </li>
  166.                                 </ul>
  167.                             {% endfor %}
  168.                         </div>
  169.                     </div>
  170.                     <div class="ec-cartRole__actions">
  171.                         <div class="ec-cartRole__total">{{ '合計:'|trans }}<span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price }}</span>
  172.                         </div>
  173.                         <a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">{{ 'レジに進む'|trans }}</a>
  174.                         {% if loop.last %}
  175.                             <a class="ec-blockBtn--cancel" href="{{ path('homepage') }}">{{ 'お買い物を続ける'|trans }}</a>
  176.                         {% endif %}
  177.                     </div>
  178.                 {% endfor %}
  179.             </form>
  180.         {% else %}
  181.             {% for CartIndex,Cart in Carts %}
  182.                 {% set cartKey = Cart.cart_key %}
  183.                 {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  184.                     <div class="ec-cartRole__error">
  185.                         <div class="ec-alert-warning">
  186.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  187.                             <div class="ec-alert-warning__text">
  188.                                 {{ error|trans|nl2br }}
  189.                             </div>
  190.                         </div>
  191.                     </div>
  192.                 {% endfor %}
  193.             {% endfor %}
  194.             <div class="ec-role">
  195.                 <div class="ec-off3Grid">
  196.                     <div class="ec-off3Grid__cell">
  197.                         <div class="ec-alert-warning">
  198.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  199.                             <div class="ec-alert-warning__text">{{ '現在カート内に商品はございません。'|trans }}</div>
  200.                         </div>
  201.                     </div>
  202.                 </div>
  203.             </div>
  204.         {% endif %}
  205.     </div>
  206. {% endblock %}