app/template/default/Block/cart.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. {% set Carts = get_all_carts() %}
  9. {% set totalPrice = get_carts_total_price() %}
  10. {% set totalQuantity = get_carts_total_quantity() %}
  11. <div id="cart_area">
  12.     <p class="clearfix cart-trigger"><a href="#cart">
  13.         <svg class="cb cb-shopping-cart">
  14.             <use xlink:href="#cb-shopping-cart"/>
  15.         </svg>
  16.         <span class="badge">{{ totalQuantity|number_format }}</span>
  17.         <svg class="cb cb-close">
  18.             <use xlink:href="#cb-close"/>
  19.         </svg>
  20.     </a>
  21.     {% if Carts is empty %}
  22.         <span class="cart_price pc">Total <span class="price">JPY0</span></span>
  23.     {% else %}
  24.         {% for Cart in Carts %}
  25.             <span class="cart_price pc">Total <span class="price">JPY{{ Cart.total_price|number_format(0, '.', ',') }}</span></span>
  26.         {% endfor %}
  27.     {% endif %}
  28.     </p>
  29.     <div id="cart" class="cart">
  30.         <div class="inner">
  31.             {% for error in app.session.flashbag.get('eccube.front.cart.error')  %}
  32.                 <div class="message">
  33.                     <p class="errormsg bg-danger">
  34.                         <svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>{{ error|trans|nl2br }}
  35.                     </p>
  36.                 </div>
  37.             {% endfor %}
  38.             {% for Cart in Carts %}
  39.                 {% for CartItem in Cart.CartItems %}
  40.                     {% set ProductClass = CartItem.ProductClass %}
  41.                     {% set Product = ProductClass.Product %}
  42.                     <div class="item_box clearfix">
  43.                         <div class="item_photo">
  44.                             <img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  45.                         </div>
  46.                         <dl class="item_detail">
  47.                             <dt class="item_name">{{ Product.name }}</dt>
  48.                             <dd class="item_pattern small">
  49.                                 <div class="item_pattern small">
  50.                                     {% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  51.                                         {{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  52.                                     {% endif %}
  53.                                     {% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  54.                                         <br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  55.                                     {% endif %}
  56.                                 </div>
  57.                             </dd>
  58.                             <dd class="item_price">{{ CartItem.price|number_format(0, '.', ',') }}<span class="small">inc.tax</span></dd>
  59.                             <dd class="item_quantity form-group form-inline">QTY:{{ CartItem.quantity }}</dd>
  60.                         </dl>
  61.                     </div>
  62.                     <p class="cart_price sp">Total <span class="price">JPY{{ CartItem.total_price|price }}</span></p>
  63.                 {% endfor %}
  64.             {% endfor %}
  65.             {% if Carts is empty %}
  66.                 <div class="btn_area">
  67.                     <div class="message">
  68.                         <p class="errormsg bg-danger" style="margin-bottom: 20px;">
  69.                             There are no items<br>currently in the cart.
  70.                         </p>
  71.                     </div>
  72.                 </div>
  73.             {% else %}
  74.                 {% for Cart in Carts %}
  75.                     <div class="btn_area">
  76.                         <ul>
  77.                             <li>
  78.                                 <a href="{{ url('cart') }}" class="btn btn-primary">Cart</a>
  79.                             </li>
  80.                         </ul>
  81.                     </div>
  82.                 {% endfor %}
  83.             {% endif %}
  84.         </div>
  85.     </div>
  86. </div>