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