{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% set Carts = get_all_carts() %}
{% set totalPrice = get_carts_total_price() %}
{% set totalQuantity = get_carts_total_quantity() %}
<div id="cart_area">
<p class="clearfix cart-trigger"><a href="#cart">
<svg class="cb cb-shopping-cart">
<use xlink:href="#cb-shopping-cart"/>
</svg>
<span class="badge">{{ totalQuantity|number_format }}</span>
<svg class="cb cb-close">
<use xlink:href="#cb-close"/>
</svg>
</a>
{% if Carts is empty %}
<span class="cart_price pc">Total <span class="price">JPY0</span></span>
{% else %}
{% for Cart in Carts %}
<span class="cart_price pc">Total <span class="price">JPY{{ Cart.total_price|number_format(0, '.', ',') }}</span></span>
{% endfor %}
{% endif %}
</p>
<div id="cart" class="cart">
<div class="inner">
{% for error in app.session.flashbag.get('eccube.front.cart.error') %}
<div class="message">
<p class="errormsg bg-danger">
<svg class="cb cb-warning"><use xlink:href="#cb-warning" /></svg>{{ error|trans|nl2br }}
</p>
</div>
{% endfor %}
{% for Cart in Carts %}
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<div class="item_box clearfix">
<div class="item_photo">
<img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
</div>
<dl class="item_detail">
<dt class="item_name">{{ Product.name }}</dt>
<dd class="item_pattern small">
<div class="item_pattern small">
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
{% endif %}
</div>
</dd>
<dd class="item_price">{{ CartItem.price|number_format(0, '.', ',') }}<span class="small">inc.tax</span></dd>
<dd class="item_quantity form-group form-inline">QTY:{{ CartItem.quantity }}</dd>
</dl>
</div>
<p class="cart_price sp">Total <span class="price">JPY{{ CartItem.total_price|price }}</span></p>
{% endfor %}
{% endfor %}
{% if Carts is empty %}
<div class="btn_area">
<div class="message">
<p class="errormsg bg-danger" style="margin-bottom: 20px;">
There are no items<br>currently in the cart.
</p>
</div>
</div>
{% else %}
{% for Cart in Carts %}
<div class="btn_area">
<ul>
<li>
<a href="{{ url('cart') }}" class="btn btn-primary">Cart</a>
</li>
</ul>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>