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.     {% set showProduct = true %}
  12.     {% if ChainStore %}
  13.         {% if ChainStore.ContractType.show_product != 'Y' %}
  14.             {% set showProduct = false %}
  15.         {% endif %}
  16.     {% endif %}
  17.     <div class="ec-role">
  18.         <div class="ec-pageHeader">
  19.             <h1>{{ 'front.cart.title'|trans }}</h1>
  20.         </div>
  21.     </div>
  22.     <div class="ec-cartRole">
  23.         <div class="ec-cartRole__progress">
  24.             <ul class="ec-progress">
  25.                 {% set step = 1 %}
  26.                 <li class="ec-progress__item is-complete">
  27.                     <div class="ec-progress__number">
  28.                         {{ step }}{% set step = step + 1 %}
  29.                     </div>
  30.                     <div class="ec-progress__label">
  31.                         {% if EnUser == false %}
  32.                             {{ 'front.cart.nav__cart_items'|trans }}
  33.                         {% else %}
  34.                             Cart
  35.                         {% endif %}
  36.                     </div>
  37.                 </li>
  38.                 {% if is_granted('ROLE_USER') == false %}
  39.                     <li class="ec-progress__item">
  40.                         <div class="ec-progress__number">
  41.                             {{ step }}{% set step = step + 1 %}
  42.                         </div>
  43.                         <div class="ec-progress__label">
  44.                             {% if EnUser == false %}
  45.                                 {{ 'front.cart.nav__customer_info'|trans }}
  46.                             {% else %}
  47.                                 Customer<br>information
  48.                             {% endif %}
  49.                         </div>
  50.                     </li>
  51.                 {% endif %}
  52.                 <li class="ec-progress__item">
  53.                     <div class="ec-progress__number">
  54.                         {{ step }}{% set step = step + 1 %}
  55.                     </div>
  56.                     <div class="ec-progress__label">
  57.                         {% if EnUser == false %}
  58.                             {{ 'front.cart.nav__order'|trans }}
  59.                         {% else %}
  60.                             Payment<br>options
  61.                         {% endif %}
  62.                     </div>
  63.                 </li>
  64.                 <li class="ec-progress__item">
  65.                     <div class="ec-progress__number">
  66.                         {{ step }}{% set step = step + 1 %}
  67.                     </div>
  68.                     <div class="ec-progress__label">
  69.                         {% if EnUser == false %}
  70.                             {{ 'front.cart.nav__confirm'|trans }}
  71.                         {% else %}
  72.                             Order<br>summary
  73.                         {% endif %}
  74.                     </div>
  75.                 </li>
  76.                 <li class="ec-progress__item">
  77.                     <div class="ec-progress__number">
  78.                         {{ step }}{% set step = step + 1 %}
  79.                     </div>
  80.                     <div class="ec-progress__label">
  81.                         {% if EnUser == false %}
  82.                             {{ 'front.cart.nav__complete'|trans }}
  83.                         {% else %}
  84.                             Confirmation
  85.                         {% endif %}
  86.                     </div>
  87.                 </li>
  88.             </ul>
  89.         </div>
  90.         {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  91.         {% for error in app.session.flashbag.get('eccube.front.request.error') %}
  92.             {% set idx = loop.index0 %}
  93.             <div class="ec-cartRole__error">
  94.                 <div class="ec-alert-warning">
  95.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  96.                     <div class="ec-alert-warning__text">
  97.                         {% if productStr[idx] is defined %}
  98.                             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  99.                         {% else %}
  100.                             {{ error|trans|nl2br }}
  101.                         {% endif %}
  102.                     </div>
  103.                 </div>
  104.             </div>
  105.         {% endfor %}
  106.         {% for error in app.session.flashbag.get('eccube.front.cart.error') %}
  107.             <div class="ec-cartRole__error">
  108.                 <div class="ec-alert-warning">
  109.                     <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  110.                     <div class="ec-alert-warning__text">
  111.                         {{ error|trans|nl2br }}
  112.                     </div>
  113.                 </div>
  114.             </div>
  115.         {% endfor %}
  116.         {% if totalQuantity > 0 and showProduct %}
  117.             <div class="ec-cartRole__totalText">
  118.                 <p>
  119.                     {% if EnUser == false %}
  120.                         {{ 'front.cart.total_price'|trans({ '%price%': totalPrice|price })|raw }}
  121.                     {% else %}
  122.                         Your order total is {{ totalPrice|price }}.
  123.                     {% endif %}
  124.                 </p>
  125.             </div>
  126.             {% if Carts|length > 1 %}
  127.                 <div class="ec-cartRole__error">
  128.                     <div class="ec-alert-warning">
  129.                         <div class="ec-alert-warning__text">
  130.                             {{ 'front.cart.divide_cart'|trans|nl2br }}
  131.                         </div>
  132.                     </div>
  133.                 </div>
  134.             {% endif %}
  135.             {% if ChainStore == false %}
  136.                 <div class="ec-cartRole__text">
  137.                     {#
  138.                     <p>配送日指定のない場合、3〜5営業日程度で発送いたします。<br>(土日祝日を除く)</p>
  139.                     #}
  140.                     {#
  141.                     <p>夏季休業に伴い8/8(火)以降のご注文は<br>8/17(木)以降に順次発送いたします。</p>
  142.                     #}
  143.                 </div>
  144.             {% endif %}
  145.             <form name="form" id="form_cart" class="ec-cartRole" method="post" action="{{ url('cart') }}">
  146.                 {% for CartIndex,Cart in Carts %}
  147.                     {% set cartKey = Cart.cart_key %}
  148.                     {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  149.                         <div class="ec-cartRole__error">
  150.                             <div class="ec-alert-warning">
  151.                                 <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  152.                                 <div class="ec-alert-warning__text">
  153.                                     {{ error|trans|nl2br }}
  154.                                 </div>
  155.                             </div>
  156.                         </div>
  157.                     {% endfor %}
  158.                     <div class="ec-cartRole__cart">
  159.                         <div class="ec-cartTable">
  160.                             <ol class="ec-cartHeader">
  161.                                 <li class="ec-cartHeader__label">
  162.                                     {% if EnUser == false %}
  163.                                         {{ 'front.cart.delete'|trans }}
  164.                                     {% else %}
  165.                                         Remove<br>Item
  166.                                     {% endif %}
  167.                                 </li>
  168.                                 <li class="ec-cartHeader__label">
  169.                                     {% if EnUser == false %}
  170.                                         {{ 'front.cart.product'|trans }}
  171.                                     {% else %}
  172.                                         Product Info
  173.                                     {% endif %}
  174.                                 </li>
  175.                                 <li class="ec-cartHeader__label">
  176.                                     {% if EnUser == false %}
  177.                                         {{ 'common.quantity'|trans }}
  178.                                     {% else %}
  179.                                         Quantity
  180.                                     {% endif %}
  181.                                 </li>
  182.                                 <li class="ec-cartHeader__label">
  183.                                     {% if EnUser == false %}
  184.                                         {{ 'common.subtotal'|trans }}
  185.                                     {% else %}
  186.                                         Subtotal
  187.                                     {% endif %}
  188.                                 </li>
  189.                             </ol>
  190.                             {% for CartItem in Cart.CartItems %}
  191.                                 {% set ProductClass = CartItem.ProductClass %}
  192.                                 {% set Product = ProductClass.Product %}
  193.                                 <ul class="ec-cartRow">
  194.                                     <li class="ec-cartRow__delColumn">
  195.                                         {% if EnUser == false %}
  196.                                             <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
  197.                                                 <img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
  198.                                             </a>
  199.                                         {% else %}
  200.                                             <a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="Are you sure you want to remove the item from your cart?">
  201.                                                 <img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
  202.                                             </a>
  203.                                         {% endif %}
  204.                                     </li>
  205.                                     <li class="ec-cartRow__contentColumn">
  206.                                         <div class="ec-cartRow__img">
  207.                                             <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  208.                                                 <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}"/>
  209.                                             </a>
  210.                                         </div>
  211.                                         <div class="ec-cartRow__summary">
  212.                                             <div class="ec-cartRow__name">
  213.                                                 <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  214.                                                 {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  215.                                                     <br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  216.                                                 {% endif %}
  217.                                                 {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  218.                                                     <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  219.                                                 {% endif %}
  220.                                             </div>
  221.                                             <div class="ec-cartRow__unitPrice">{{ CartItem.price|price }}</div>
  222.                                             <div class="ec-cartRow__sutbtotalSP">
  223.                                                 {% if EnUser == false %}
  224.                                                     {{ 'common.subtotal__with_separator'|trans }}
  225.                                                 {% else %}
  226.                                                     <span style="font-size: 10px;">Subtotal:</span>
  227.                                                 {% endif %}
  228.                                                 {{ CartItem.total_price|price }}
  229.                                             </div>
  230.                                         </div>
  231.                                     </li>
  232.                                     <li class="ec-cartRow__amountColumn">
  233.                                         <div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
  234.                                         <div class="ec-cartRow__amountSP">
  235.                                             {% if EnUser == false %}
  236.                                                 {{ 'common.quantity__with_separator'|trans }}
  237.                                             {% else %}
  238.                                                 <span style="font-size: 10px;">Quantity:</span><br>
  239.                                             {% endif %}
  240.                                             {{ CartItem.quantity|number_format }}
  241.                                         </div>
  242.                                         <div class="ec-cartRow__amountUpDown">
  243.                                             {% if CartItem.quantity > 1 %}
  244.                                                 <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">
  245.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus-dark.svg') }}" alt="reduce"></span>
  246.                                                 </a>
  247.                                             {% else %}
  248.                                                 <div class="ec-cartRow__amountDownButtonDisabled">
  249.                                                     <span class="ec-cartRow__amountDownButton__icon"><img src="{{ asset('assets/icon/minus.svg') }}" alt="reduce"></span>
  250.                                                 </div>
  251.                                             {% endif %}
  252.                                             <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">
  253.                                                 <span class="ec-cartRow__amountUpButton__icon"><img src="{{ asset('assets/icon/plus-dark.svg') }}" alt="increase"></span>
  254.                                             </a>
  255.                                         </div>
  256.                                     </li>
  257.                                     <li class="ec-cartRow__subtotalColumn">
  258.                                         <div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
  259.                                     </li>
  260.                                 </ul>
  261.                             {% endfor %}
  262.                         </div>
  263.                     </div>
  264.                     <div class="ec-cartRole__progress">
  265.                         {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  266.                             <br/>
  267.                             {% if is_delivery_free[cartKey] %}
  268.                                 {{ 'front.cart.delivery_fee_free__now'|trans }}
  269.                             {% else %}
  270.                                 {{ 'front.cart.delivery_fee_free__price_and_quantity'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
  271.                             {% endif %}
  272.                         {% elseif BaseInfo.delivery_free_amount %}
  273.                             <br/>
  274.                             {% if is_delivery_free[cartKey] %}
  275.                                 {{ 'front.cart.delivery_fee_free__now'|trans }}
  276.                             {% else %}
  277.                                 {{ 'front.cart.delivery_fee_free__price'|trans({ '%price%': least[cartKey]|price })|raw }}
  278.                             {% endif %}
  279.                         {% elseif BaseInfo.delivery_free_quantity %}
  280.                             <br/>
  281.                             {% if is_delivery_free[cartKey] %}
  282.                                 {{ 'front.cart.delivery_fee_free__now'|trans }}
  283.                             {% else %}
  284.                                 {{ 'front.cart.delivery_fee_free__quantity'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
  285.                             {% endif %}
  286.                         {% endif %}
  287.                     </div>
  288.                     <div class="ec-cartRole__actions">
  289.                         <div class="ec-cartRole__total">
  290.                             {% if EnUser == false %}
  291.                                 {{ 'common.total__with_separator'|trans }}
  292.                             {% else %}
  293.                                 Total:
  294.                             {% endif %}
  295.                             <span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price }}</span>
  296.                             <span class="ec-cartRole__totalTax">
  297.                                 {% if EnUser == false %}
  298.                                     (税込)
  299.                                 {% else %}
  300.                                     (incl. tax)
  301.                                 {% endif %}
  302.                             </span>
  303.                         </div>
  304.                         <a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">
  305.                             {% if EnUser == false %}
  306.                                 {{ 'front.cart.checkout'|trans }}
  307.                             {% else %}
  308.                                 Proceed to checkout
  309.                             {% endif %}
  310.                         </a>
  311.                         {% if loop.last %}
  312.                             <a class="ec-blockBtn--cancel" href="{{ path('product_list') }}">
  313.                                 {% if EnUser == false %}
  314.                                     {{ 'front.cart.continue'|trans }}
  315.                                 {% else %}
  316.                                     Keep shopping
  317.                                 {% endif %}
  318.                             </a>
  319.                         {% endif %}
  320.                     </div>
  321.                 {% endfor %}
  322.             </form>
  323.         {% else %}
  324.             {% for CartIndex,Cart in Carts %}
  325.                 {% set cartKey = Cart.cart_key %}
  326.                 {% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
  327.                     <div class="ec-cartRole__error">
  328.                         <div class="ec-alert-warning">
  329.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  330.                             <div class="ec-alert-warning__text">
  331.                                 {{ error|trans|nl2br }}
  332.                             </div>
  333.                         </div>
  334.                     </div>
  335.                 {% endfor %}
  336.             {% endfor %}
  337.             <div class="ec-role">
  338.                 <div class="ec-off3Grid">
  339.                     <div class="ec-off3Grid__cell">
  340.                         <div class="ec-alert-warning">
  341.                             <div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
  342.                             <div class="ec-alert-warning__text">{{ (EnUser ? 'There are currently no items in your cart.' : 'front.cart.no_items')|trans }}</div>
  343.                         </div>
  344.                     </div>
  345.                 </div>
  346.             </div>
  347.         {% endif %}
  348.     </div>
  349.     {#
  350.     <div class="ec-cartRole__notice">
  351.         <p class="ec-cartRole__notice-text">※クレジットカードをご使用の場合は、@cardservice.co.jpのドメインのEメールの受信設定をご確認お願いいたします。</p>
  352.     </div>
  353.     #}
  354. {% endblock %}