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