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.                                 {% if Product.hasTag('男女兼用') %}<div class="tagicon ken">男女兼用</div>
  73.                                 {% elseif Product.hasTag('女子') %}<div class="tagicon la">Ladies'</div>
  74.                                 {% elseif Product.hasTag('男子') %}<div class="tagicon me">Men's</div>{% else %}{% endif %}
  75.                             </dd>
  76.                             <dd class="item_pattern small">
  77.                                 {%- if ProductClass.ClassCategory1 -%}
  78.                                     {{ ProductClass.ClassCategory1.ClassName }}:{{ ProductClass.ClassCategory1 }}
  79.                                     {%- if ProductClass.ClassCategory2 -%}
  80.                                         <br>{{ ProductClass.ClassCategory2.ClassName }}:{{ ProductClass.ClassCategory2 }}
  81.                                     {%- endif -%}
  82.                                 {%- endif -%}
  83.                             </dd>
  84.                             <dd class="item_price">{{ CartItem.price|price }}<span class="small">税込</span></dd>
  85.                             <dd class="item_quantity form-group form-inline">数量:{{ CartItem.quantity }}</dd>
  86.                         </dl>
  87.                     </div><!--/item_box-->
  88.                     <p class="cart_price sp">合計 <span class="price">{{ Cart.total_price|price }}</span></p>
  89.                 {% endfor %}
  90.                 {% if Cart.CartItems|length > 4 %}
  91.                     <div class="btn_area">
  92.                         <ul>
  93.                             <li>
  94.                                 <a href="{{ url('cart') }}" class="btn btn-primary def_btn radius1">カートへ進む</a>
  95.                             </li>
  96.                             <li>
  97.                                 <button type="button" class="btn btn-default btn-sm cart-trigger">キャンセル</button>
  98.                             </li>
  99.                         </ul>
  100.                     </div>
  101.                 {% else %}{% endif %}
  102.             {% endfor %}
  103.         </div>
  104.     </div>
  105. </div>
  106. {% else %}
  107. {% endif %}