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