app/template/default/Cart/index.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
  4. http://www.lockon.co.jp/
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  16. #}
  17. {% extends 'default_frame.twig' %}
  18. {% set body_class = 'cart_page' %}
  19. {% block main %}
  20. <script>
  21.     $(document).ready(function() {
  22.         $('#restart').on('click', function(){
  23.             $.post( '/reservation_english/html/', 'mode=set_cancel' )
  24.             .done(function(data) {
  25.                 document.write(data);
  26.             })
  27.         });
  28.     })
  29. </script>
  30.     <div id="cart" class="container-fluid">
  31.         <div id="cart_box" class="row">
  32.             <div id="cart_box__body" class="col-md-10 col-md-offset-1">
  33.                 {% if is_granted('ROLE_USER') %}
  34.                 <div id="cart_box__flow_state" class="flowline step3">
  35.                 {% else %}
  36.                 <div id="cart_box__flow_state" class="flowline step4">
  37.                 {% endif %}
  38.                     <ul id="cart_box__flow_state_list" class="clearfix">
  39.                         <li class="active"><span class="flow_number">1</span><br>CART</li>
  40.                     {% if is_granted('ROLE_USER') %}
  41.                         <li><span class="flow_number">2</span><br>YOUR INFORMATION</li>
  42.                         <li><span class="flow_number">3</span><br>DELIVERY</li>
  43.                     {% else %}
  44.                         <li><span class="flow_number">2</span><br>YOUR INFORMATION</li>
  45.                         <li><span class="flow_number">3</span><br>DELIVERY</li>
  46.                         <li><span class="flow_number">4</span><br>PAYMENT</li>
  47.                     {% endif %}
  48.                     </ul>
  49.                 </div>
  50.                 {% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
  51.                 {% for error in app.session.flashbag.get('eccube.front.request.error')  %}
  52.                     {% set idx = loop.index0 %}
  53.                     {% if productStr[idx] is defined %}
  54.                     <div id="cart_box__message--{{ loop.index }}" class="message">
  55.                         <p class="errormsg bg-danger">
  56.                             <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>
  57.                             {{ error|trans({'%product%':productStr[idx]})|nl2br }}
  58.                         </p>
  59.                     </div>
  60.                     {% else %}
  61.                     <div id="cart_box__message--{{ loop.index }}" class="message">
  62.                         <p class="errormsg bg-danger">
  63.                             <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>{{ error|trans|nl2br }}
  64.                         </p>
  65.                     </div>
  66.                     {% endif %}
  67.                 {% endfor %}
  68.                 {% for error in app.session.flashbag.get('eccube.front.cart.error')  %}
  69.                     <div id="cart_box__message_error--{{ loop.index }}" class="message">
  70.                         <p class="errormsg bg-danger">
  71.                             <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>{{ error|trans|nl2br }}
  72.                         </p>
  73.                     </div>
  74.                 {% endfor %}
  75.                         {% if totalQuantity > 0 %}
  76.                         {% for Cart in Carts %}
  77.                             <form name="form" id="form_cart" method="post" action="{{ url('cart') }}">
  78.                                 <p id="cart_item__info" class="message">
  79.                                 <center><h1><font color="##5CB1B1">&#x25BE;</font><font color="##5CB1B1">&#x25BE;</font><font color="##5CB1B1">&#x25BE;</font>SHOPPING CART<font color="##5CB1B1">&#x25BE;</font><font color="##5CB1B1">&#x25BE;</font><font color="##5CB1B1">&#x25BE;</font></h1></center>
  80.                                     <center><h2>Total price is「<strong>{{ Cart.total_price|price }}</strong>」JPY(inc.tax)</h2></center>
  81.                                     {% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
  82.                                         <br />
  83.                                         {% if is_delivery_free %}
  84.                                             現在送料無料です。
  85.                                         {% else %}
  86.                                             あと「<strong>{{ least|price }}</strong>」または「<strong>{{ quantity|number_format }}個</strong>」のお買い上げで<strong class="text-primary">送料無料</strong>になります。
  87.                                         {% endif %}
  88.                                     {% elseif BaseInfo.delivery_free_amount %}
  89.                                         <br />
  90.                                         {% if is_delivery_free %}
  91.                                             現在送料無料です。
  92.                                         {% else %}
  93.                                             あと「<strong>{{ least|price }}</strong>」のお買い上げで<strong class="text-primary">送料無料</strong>になります。
  94.                                         {% endif %}
  95.                                     {% elseif BaseInfo.delivery_free_quantity %}
  96.                                         <br />
  97.                                         {% if is_delivery_free %}
  98.                                             現在送料無料です。
  99.                                         {% else %}
  100.                                             あと「<strong>{{ quantity|number_format }}個</strong>」のお買い上げで<strong class="text-primary">送料無料</strong>になります。
  101.                                         {% endif %}
  102.                                     {% endif %}
  103.                                 </p>
  104.                                 <div id="cart_item_list" class="cart_item table">
  105.                                     <div class="thead">
  106.                                         <ol id="cart_item_list__header">
  107.                                             <li id="cart_item_list__header_cart_remove">Del</li>
  108.                                             <li id="cart_item_list__header_product_detail">Contents</li>
  109.                                             <li id="cart_item_list__header_total">QTY</li>
  110.                                             <li id="cart_item_list__header_sub_total">Total</li>
  111.                                         </ol>
  112.                                     </div>
  113.                                     <div id="cart_item_list__body" class="tbody">
  114.                                         {% for CartItem in Cart.CartItems %}
  115.                                             {% set ProductClass = CartItem.productClass %}
  116.                                             {% set Product = ProductClass.Product %}
  117.                                             <div id="cart_item_list__item" class="item_box tr">
  118.                                                 <div id="cart_item_list__cart_remove" class="icon_edit td">
  119.                                                     <a href="{{ url('cart_remove', {'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} data-method="put" data-message="Are you sure you want to remove the item from the shopping cart?">
  120.                                                         <svg class="cb cb-close"><use xlink:href="#cb-close" /></svg>
  121.                                                     </a>
  122.                                                 </div>
  123.                                                 <div class="td table">
  124.                                                     <div id="cart_item_list__product_image" class="item_photo">
  125.                                                         <a  target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
  126.                                                             <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}" />
  127.                                                         </a>
  128.                                                     </div>
  129.                                                     <dl class="item_detail">
  130.                                                         <dt id="cart_item_list__product_detail" class="item_name text-default">
  131.                                                             <a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
  132.                                                         </dt>
  133.                                                         <dd id="cart_item_list__class_category" class="item_pattern small">
  134.                                                             {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  135.                                                                 {{ ProductClass.ClassCategory1.ClassName }}:{{ ProductClass.ClassCategory1 }}
  136.                                                             {% endif %}
  137.                                                             {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  138.                                                                 <br>{{ ProductClass.ClassCategory2.ClassName }}:{{ ProductClass.ClassCategory2 }}
  139.                                                             {% endif %}
  140.                                                         </dd>
  141.                                                         <dd id="cart_item_list__item_price" class="item_price">JPY{{ CartItem.price|number_format }}</dd>
  142.                                                         <dd id="cart_item_list__item_subtotal" class="item_subtotal">小計:JPY{{ CartItem.total_price|number_format }}</dd>
  143.                                                     </dl>
  144.                                                 </div>
  145.                                                 <div id="cart_item_list__quantity" class="item_quantity td">
  146.                                                     {{ CartItem.quantity|number_format }}
  147.                                                     <ul id="cart_item_list__quantity_edit">
  148.                                                         <li>
  149.                                                             {% if CartItem.quantity > 1 %}
  150.                                                                 <a id="cart_item_list__down" href="{{ url('cart_down', {'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} data-method="put" data-confirm="false"><svg class="cb cb-minus"><use xlink:href="#cb-minus" /></svg></a>
  151.                                                             {% else %}
  152.                                                                 <span><svg class="cb cb-minus"><use xlink:href="#cb-minus" /></svg></span>
  153.                                                             {% endif %}
  154.                                                         </li>
  155.                                                         <li>
  156.                                                             <a id="cart_item_list__up" href="{{ url('cart_up', {'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} data-method="put" data-confirm="false"><svg class="cb cb-plus"><use xlink:href="#cb-plus" /></svg></a>
  157.                                                         </li>
  158.                                                     </ul>
  159.                                                 </div>
  160.                                                 <div id="cart_item_list__subtotal" class="item_subtotal td">JPY{{ CartItem.total_price|number_format }}</div>
  161.                                             </div><!--/item_box-->
  162.                                         {% endfor %}
  163.                                     </div>
  164.                                 </div><!--/cart_item-->
  165.                                 <div class="total_box">
  166.                                     <dl id="total_box__total_price" class="total_price">
  167.                                         <dt>Total:</dt>
  168.                                         <dd class="text-primary">JPY{{ Cart.total_price|number_format }}</dd>
  169.                                     </dl>
  170.                                     <div id="total_box__user_action_menu" class="btn_group">
  171.                                         <p id="total_box__next_button" >
  172.                                         <a href="{{ path('cart_buystep') }}" class="btn btn-primary btn-block">NEXT</a>
  173.                                         </p>
  174.                                         <p id="total_box__top_button">
  175.                                             <a  id="restart" href="/reservation_english/html/index.php" class="btn btn-info btn-block">Restart Order</a>
  176.                                         </p>
  177.                                     </div>
  178.                                 </div>
  179.                             </form>
  180.                         {% endfor %}
  181.                         {% else %}
  182.                             <div id="cart_box__message" class="message">
  183.                                 <p class="errormsg bg-danger">
  184.                                     <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>Now enpty !
  185.                                 </p>
  186.                                 <p id="total_box__next_button" >
  187.                                     <a href="/reservation_english/html/index.php" class="btn btn-primary btn-block">ORDER TOP</a>
  188.                                 </p>
  189.                             </div>
  190.                         {% endif %}
  191.             </div><!-- /.col -->
  192.         </div><!-- /.row -->
  193.     </div>
  194. {% endblock %}