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