app/template/unishop/Block/cart.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. {% set Carts = get_all_carts() %}
  18. {% set totalPrice = get_carts_total_price() %}
  19. {% set totalQuantity = get_carts_total_quantity() %}
  20. {% if is_granted('ROLE_USER') %}
  21. <div id="cart_area">
  22.     <p class="clearfix cart-trigger"><a href="#cart">
  23.             <img class="cartimg" src="{{ asset('assets') }}/img/unishop/icon_cart.gif" />
  24.             <span class="badge">{{ totalQuantity|number_format }}</span>
  25.             <svg class="cb cb-close">
  26.                 <use xlink:href="#cb-close"/>
  27.             </svg>
  28.         </a>
  29.         <span class="cart_price pc">カート</span></p>
  30.     <div id="cart" class="cart">
  31.         <div class="inner">
  32.             {% for error in app.session.flashbag.get('eccube.front.cart.error')  %}
  33.                 <div class="message">
  34.                     <p class="errormsg bg-danger">
  35.                         <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>{{ error|trans|nl2br }}
  36.                     </p>
  37.                 </div>
  38.             {% endfor %}
  39.             {% for Cart in Carts %}
  40.                 {% if Cart.CartItems|length > 0 %}
  41.                     <div class="btn_area">
  42.                         <ul>
  43.                             <li>
  44.                                 <a href="{{ url('cart') }}" class="btn btn-primary def_btn radius1">カートへ進む</a>
  45.                             </li>
  46.                             <li>
  47.                                 <button type="button" class="btn btn-default btn-sm cart-trigger">キャンセル</button>
  48.                             </li>
  49.                         </ul>
  50.                     </div>
  51.                 {% else %}
  52.                     <div class="btn_area">
  53.                         <div class="message">
  54.                             <p class="errormsg bg-danger" style="margin-bottom: 20px;">
  55.                                 現在カート内に<br>商品はございません。
  56.                             </p>
  57.                         </div>
  58.                     </div>
  59.                 {% endif %}
  60.             {% endfor %}
  61.             {% for Cart in Carts %}
  62.                 {% for CartItem in Cart.CartItems %}
  63.                     {% set ProductClass = CartItem.ProductClass %}
  64.                     {% set Product = ProductClass.Product %}
  65.                     <div class="item_box clearfix">
  66.                         <div class="item_photo"><img
  67.                                     src="{{ asset(Product.MainListImage|no_image_product , 'save_image') }}"
  68.                                     alt="{{ Product.name }}"></div>
  69.                         <dl class="item_detail">
  70.                             <dt class="item_name">{{ Product.name }}</dt>
  71.                             <dd>
  72.                                 {% include 'Block/product_sex_tag.twig' %}
  73.                             </dd>
  74.                             <dd class="item_pattern small">
  75.                                 {%- if ProductClass.ClassCategory1 -%}
  76.                                     サイズ:{{ ProductClass.ClassCategory1 }}
  77.                                     {%- if ProductClass.ClassCategory2 -%}
  78.                                         <br>サイズ:{{ ProductClass.ClassCategory2 }}
  79.                                     {%- endif -%}
  80.                                 {%- endif -%}
  81.                             </dd>
  82.                             <dd class="item_price">{{ CartItem.price|price }}<span class="small">税込</span></dd>
  83.                             <dd class="item_quantity form-group form-inline">数量:{{ CartItem.quantity }}</dd>
  84.                         </dl>
  85.                     </div><!--/item_box-->
  86.                     <p class="cart_price sp">合計 <span class="price">{{ Cart.total_price|price }}</span></p>
  87.                 {% endfor %}
  88.                 {% if Cart.CartItems|length > 4 %}
  89.                     <div class="btn_area">
  90.                         <ul>
  91.                             <li>
  92.                                 <a href="{{ url('cart') }}" class="btn btn-primary def_btn radius1">カートへ進む</a>
  93.                             </li>
  94.                             <li>
  95.                                 <button type="button" class="btn btn-default btn-sm cart-trigger">キャンセル</button>
  96.                             </li>
  97.                         </ul>
  98.                     </div>
  99.                 {% else %}{% endif %}
  100.             {% endfor %}
  101.         </div>
  102.     </div>
  103. </div>
  104. {% else %}
  105. {% endif %}