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