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 id="isCartPage"></div>
  12.     <div class="ec-role">
  13.         <div class="ec-pageHeader">
  14.             <h1>{{ 'ショッピングカート'|trans }}</h1>
  15.         </div>
  16.     </div>
  17.     <div class="ec-cartRole">
  18.         <div class="ec-cartRole__progress">
  19.             <ul class="ec-progress">
  20.                 {% set step = 1 %}
  21.                 <li class="ec-progress__item is-complete">
  22.                     <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  23.                     </div>
  24.                     <div class="ec-progress__label">{{ 'カートの商品'|trans }}
  25.                     </div>
  26.                 </li>
  27.                 {% if is_granted('ROLE_USER') == false %}
  28.                     <li class="ec-progress__item">
  29.                         <div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
  30.                         </div>
  31.                         <div class="ec-progress__label">{{ 'お客様情報'|trans }}
  32.                         </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">{{ 'ご注文手続き'|trans }}
  39.                     </div>
  40.                 </li>
  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.             </ul>
  54.         </div>
  55.         {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  56.         {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  57.             {% set idx = loop.index0 %}
  58.             <div class="ec-cartRole__error">
  59.                 <div class="ec-alert-warning">
  60.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  61.                     <div class="ec-alert-warning__text">
  62.                         {% if productStr[idx] is defined %}
  63.                             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  64.                         {% else %}
  65.                             {{ error|trans|nl2br }}
  66.                         {% endif %}
  67.                     </div>
  68.                 </div>
  69.             </div>
  70.         {% endfor %}
  71.         {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  72.             <div class="ec-cartRole__error">
  73.                 <div class="ec-alert-warning">
  74.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  75.                     <div class="ec-alert-warning__text">
  76.                         {{ error|trans|nl2br }}
  77.                     </div>
  78.                 </div>
  79.             </div>
  80.         {% endfor %}
  81.         {% if totalQuantity > 0 %}
  82.             <div class="ec-cartRole__totalText">
  83.                 <p>
  84.                     {{ '商品の合計金額は「<strong>%price%</strong>」です。'|trans({ '%price%': totalPrice|price })|raw }}
  85.                 </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.                                     
  127.                                     <li class="ec-cartRow__contentColumn">
  128.                                         <div class="ec-cartRow__img">
  129.                                             <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  130.                                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}"/>
  131.                                             </a>
  132.                                         </div>
  133.                                         <div class="ec-cartRow__summary">
  134.                                             <div class="ec-cartRow__name">
  135.                                                 <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  136.                                                 {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  137.                                                     <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  138.                                                 {% endif %}
  139.                                                 {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  140.                                                     <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  141.                                                 {% endif %}
  142.                                             </div>
  143.                                             {% if loanProducts %}
  144.                                                 {% set checkProductIdLoan = 0 %}
  145.                                                 {% for loanProduct in loanProducts %}
  146.                                                     {% if (loanProduct.id == Product.id) %}
  147.                                                         {% set checkProductIdLoan = 1 %}
  148.                                                     {% endif %}
  149.                                                 {% endfor %}
  150.                                                 {% if checkProductIdLoan == 1 %}
  151.                                                     {% set priceProduct = ((CartItem.price / 24 / 10) // 1 * 10) %}
  152.                                                     <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }} <span>月々{{ priceProduct|number_format(0, ",") }}/24回払い</span></div>
  153.                                                 {% else %}
  154.                                                     <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }} </div>
  155.                                                 {% endif %}
  156.                                             {% else %}
  157.                                                 <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }} </div>
  158.                                             {% endif %}
  159.                                             <div class="ec-cartRow__sutbtotalSP">{{ '小計:'|trans }}{{ CartItem.total_price|price }}</div>
  160.                                         </div>
  161.                                     </li>
  162.                                     <li class="ec-cartRow__amountColumn">
  163.                                         {% if (app.environment == 'prod' and Product.id == 1289) or (app.environment != 'prod' and Product.id == 1289) %}
  164.                                         {% else %}
  165.                                             <div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
  166.                                             <div class="ec-cartRow__amountSP">{{ '数量:'|trans }}{{ CartItem.quantity|number_format }}</div>
  167.                                             <div class="ec-cartRow__amountUpDown">
  168.                                                 {% if CartItem.quantity > 1 %}
  169.                                                     <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">
  170.                                                         <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus-dark.svg') }}" alt="reduce"></span>
  171.                                                     </a>
  172.                                                 {% else %}
  173.                                                     <div class="ec-cartRow__amountDownButtonDisabled">
  174.                                                         <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus.svg') }}" alt="reduce"></span>
  175.                                                     </div>
  176.                                                 {% endif %}
  177.                                                 <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">
  178.                                                     <span class="ec-cartRow__amountUpButton__icon"><img src="{{ asset('assets/icon/plus-dark.svg') }}" alt="increase"></span>
  179.                                                 </a>
  180.                                             </div>
  181.                                         {% endif %}
  182.                                     </li>
  183.                                     <li class="ec-cartRow__subtotalColumn">
  184.                                         <div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
  185.                                     </li>
  186.                                 </ul>
  187.                             {% endfor %}
  188.                         </div>
  189.                     </div>
  190.                     <div class="ec-cartRole__progress">
  191.                         {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  192.                             <br/>
  193.                             {% if is_delivery_free[cartKey] %}
  194.                                 {{ '現在送料無料です。'|trans }}
  195.                             {% else %}
  196.                                 {{ 'あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
  197.                             {% endif %}
  198.                         {% elseif BaseInfo.delivery_free_amount %}
  199.                             <br/>
  200.                             {% if is_delivery_free[cartKey] %}
  201.                                 {{ '現在送料無料です。'|trans }}
  202.                             {% else %}
  203.                                 {{ 'あと「<strong>%price%</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price })|raw }}
  204.                             {% endif %}
  205.                         {% elseif BaseInfo.delivery_free_quantity %}
  206.                             <br/>
  207.                             {% if is_delivery_free[cartKey] %}
  208.                                 {{ '現在送料無料です。'|trans }}
  209.                             {% else %}
  210.                                 {{ 'あと「<strong>%quantity%個</strong>」のお買い上げで<strong class="ec-color-red">送料無料</strong>になります。'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
  211.                             {% endif %}
  212.                         {% endif %}
  213.                     </div>
  214.                     <div class="ec-cartRole__actions">
  215.                         {% set countProductLoan = 0 %}
  216.                         {% set countProduct = 0 %}
  217.                         {% for loanProduct in loanProducts %}
  218.                              {% set countProductLoan = countProductLoan + 1 %}
  219.                         {% endfor %}
  220.                         {% for CartIndex,Cart in Carts %}
  221.                         {% for CartItem in Cart.CartItems %}
  222.                             {% set countProduct = countProduct + 1 %}
  223.                         {% endfor %}
  224.                         {% endfor %}
  225.                         <div class="ec-cartRole__total">
  226.                             {% if (countProductLoan == countProduct) %}
  227.                             {{ '合計:'|trans }}<span class="" style="font-weight: normal;">{{ Cart.totalPrice|price }}</span>
  228.                             {% else %}
  229.                             {{ '合計:'|trans }}<span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price }}</span>
  230.                             {% endif %}
  231.                         </div>
  232.                         {% if is_construction_only == true %}
  233.                             <a class="ec-blockBtn--action" href="{{ url('construction_only') }}">{{ '購入にすすむ'|trans }}</a>
  234.                         {% else %}
  235.                             <a class="ec-blockBtn--action" href="{{ url('construction') }}">{{ '購入にすすむ'|trans }}</a>
  236.                         {% endif %}
  237.                         
  238.                         {# <a class="ec-blockBtn--set0y" href="{{ url('contact') }}?type=0">{{ '本体購入+設置工事の方はこちら'|trans }}</a> #}
  239.                         {# <a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">{{ '本体のみ購入の方はこちら'|trans }}</a> #}
  240.                         {# {% if loop.last %}
  241.                             <a class="ec-blockBtn--cancel" href="{{ path('homepage') }}">{{ 'お買い物を続ける'|trans }}</a>
  242.                         {% endif %} #}
  243.                         {# <a class="ec-blockBtn--express" href="{{ url('product_detail', {'id': 1207}) }}">{{ '工事特急券のご使用はこちら'|trans }}</a> #}
  244.                     </div>
  245.                 {% endfor %}
  246.             </form>
  247.         {% else %}
  248.             {% for CartIndex,Cart in Carts %}
  249.                 {% set cartKey = Cart.cart_key %}
  250.                 {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  251.                     <div class="ec-cartRole__error">
  252.                         <div class="ec-alert-warning">
  253.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  254.                             <div class="ec-alert-warning__text">
  255.                                 {{ error|trans|nl2br }}
  256.                             </div>
  257.                         </div>
  258.                     </div>
  259.                 {% endfor %}
  260.             {% endfor %}
  261.             <div class="ec-role">
  262.                 <div class="ec-off3Grid">
  263.                     <div class="ec-off3Grid__cell">
  264.                         <div class="ec-alert-warning">
  265.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  266.                             <div class="ec-alert-warning__text">{{ '現在カート内に商品はございません。'|trans }}</div>
  267.                         </div>
  268.                     </div>
  269.                 </div>
  270.             </div>
  271.         {% endif %}
  272.     </div>
  273. {% endblock %}