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