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.         <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.             {% if "now"|date("H") > 11 and "now"|date("H") < 19 %}
  86.             {% else %}
  87.                 <p style="margin-top:20px;">ご注文の受付は<span style="font-weight:bold;color:#ff0000;">11時から19時まで</span>となっており、19時以降の注文の受付はできかねます。<br>
  88.                 翌11時より改めてご注文手続きをしていただきますようよろしくお願いいたします。</p>
  89.             {% endif %}
  90.             </div>
  91.             {% if Carts|length > 1 %}
  92.                 <div class="ec-cartRole__error">
  93.                     <div class="ec-alert-warning">
  94.                         <div class="ec-alert-warning__text">
  95.                             {{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
  96.                         </div>
  97.                     </div>
  98.                 </div>
  99.             {% endif %}
  100.             <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  101.                 {% for CartIndex,Cart in Carts %}
  102.                     {% set cartKey = Cart.cart_key %}
  103.                     {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  104.                         <div class="ec-cartRole__error">
  105.                             <div class="ec-alert-warning">
  106.                                 <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  107.                                 <div class="ec-alert-warning__text">
  108.                                     {{ error|trans|nl2br }}
  109.                                 </div>
  110.                             </div>
  111.                         </div>
  112.                     {% endfor %}
  113.                     <div class="ec-cartRole__cart">
  114.                         <div class="ec-cartTable">
  115.                             <ol class="ec-cartHeader">
  116.                                 <li class="ec-cartHeader__label">{{ '削除'|trans }}</li>
  117.                                 <li class="ec-cartHeader__label">{{ '商品内容'|trans }}</li>
  118.                                 <li class="ec-cartHeader__label">{{ '数量'|trans }}</li>
  119.                                 <li class="ec-cartHeader__label">{{ '小計'|trans }}</li>
  120.                             </ol>
  121.                             {% for CartItem in Cart.CartItems %}
  122.                                 {% set ProductClass = CartItem.ProductClass %}
  123.                                 {% set Product = ProductClass.Product %}
  124.                                 <ul class="ec-cartRow">
  125.                                     <li class="ec-cartRow__delColumn">
  126.                                         <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
  127.                                             <img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
  128.                                         </a>
  129.                                     </li>
  130.                                     <li class="ec-cartRow__contentColumn">
  131.                                         <div class="ec-cartRow__img">
  132.                                             <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  133.                                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}"/>
  134.                                             </a>
  135.                                         </div>
  136.                                         <div class="ec-cartRow__summary">
  137.                                             <div class="ec-cartRow__name">
  138.                                                 <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  139.                                                 {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  140.                                                     <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  141.                                                 {% endif %}
  142.                                                 {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  143.                                                     <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  144.                                                 {% endif %}
  145.                                             </div>
  146.                                             <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }}</div>
  147.                                             <div class="ec-cartRow__sutbtotalSP">{{ '小計:'|trans }}{{ CartItem.total_price|price }}</div>
  148.                                         </div>
  149.                                     </li>
  150.                                     <li class="ec-cartRow__amountColumn">
  151.                                         <div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
  152.                                         <div class="ec-cartRow__amountSP">{{ '数量:'|trans }}{{ CartItem.quantity|number_format }}</div>
  153.                                         <div class="ec-cartRow__amountUpDown">
  154.                                             {% if CartItem.quantity > 1 %}
  155.                                                 <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">
  156.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus-dark.svg') }}" alt="reduce"></span>
  157.                                                 </a>
  158.                                             {% else %}
  159.                                                 <div class="ec-cartRow__amountDownButtonDisabled">
  160.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus.svg') }}" alt="reduce"></span>
  161.                                                 </div>
  162.                                             {% endif %}
  163.                                             <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">
  164.                                                 <span class="ec-cartRow__amountUpButton__icon"><img src="{{ asset('assets/icon/plus-dark.svg') }}" alt="increase"></span>
  165.                                             </a>
  166.                                         </div>
  167.                                     </li>
  168.                                     <li class="ec-cartRow__subtotalColumn">
  169.                                         <div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
  170.                                     </li>
  171.                                 </ul>
  172.                             {% endfor %}
  173.                         </div>
  174.                     </div>
  175.                     <div class="ec-cartRole__progress">
  176.                         {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  177.                             <br/>
  178.                             {% if is_delivery_free[cartKey] %}
  179.                                 {{ '現在送料無料です。'|trans }}
  180.                             {% else %}
  181.                                 {{ 'あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
  182.                             {% endif %}
  183.                         {% elseif BaseInfo.delivery_free_amount %}
  184.                             <br/>
  185.                             {% if is_delivery_free[cartKey] %}
  186.                                 {{ '現在送料無料です。'|trans }}
  187.                             {% else %}
  188.                                 {{ 'あと「<strong>%price%</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price })|raw }}
  189.                             {% endif %}
  190.                         {% elseif BaseInfo.delivery_free_quantity %}
  191.                             <br/>
  192.                             {% if is_delivery_free[cartKey] %}
  193.                                 {{ '現在送料無料です。'|trans }}
  194.                             {% else %}
  195.                                 {{ 'あと「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
  196.                             {% endif %}
  197.                         {% endif %}
  198.                     </div>
  199.                     <div class="ec-cartRole__actions">
  200.                         <div class="ec-cartRole__total">{{ '合計:'|trans }}<span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price }}</span>
  201.                         </div>
  202.                         
  203.                         <a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">{{ 'レジに進む'|trans }}</a>
  204.                         {% if loop.last %}
  205.                             <a class="ec-blockBtn--cancel" href="{{ path('homepage') }}">{{ 'お買い物を続ける'|trans }}</a>
  206.                         {% endif %}
  207.                     </div>
  208.                 {% endfor %}
  209.             </form>
  210.         {% else %}
  211.             {% for CartIndex,Cart in Carts %}
  212.                 {% set cartKey = Cart.cart_key %}
  213.                 {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  214.                     <div class="ec-cartRole__error">
  215.                         <div class="ec-alert-warning">
  216.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  217.                             <div class="ec-alert-warning__text">
  218.                                 {{ error|trans|nl2br }}
  219.                             </div>
  220.                         </div>
  221.                     </div>
  222.                 {% endfor %}
  223.             {% endfor %}
  224.             <div class="ec-role">
  225.                 <div class="ec-off3Grid">
  226.                     <div class="ec-off3Grid__cell">
  227.                         <div class="ec-alert-warning">
  228.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  229.                             <div class="ec-alert-warning__text">{{ '現在カート内に商品はございません。'|trans }}</div>
  230.                         </div>
  231.                     </div>
  232.                 </div>
  233.             </div>
  234.         {% endif %}
  235.     </div>
  236. {% endblock %}