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