{#
This file is part of EC-CUBE
Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
http://www.lockon.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 class="b-cart" id="js-cart">
<div class="b-cart__trigger" id="js-cart-trigger">
<div class="b-cart__menu">
<span class="b-cart__menu-badge">{{ totalQuantity|number_format }}</span>
</div>
</div>
<div class="b-cart__overlay js-cart-target" id="js-cart__overlay"></div>
{% if totalQuantity > 0 %}
<div class="b-cart__body js-cart-target">
<div class="b-cart__heading">
<div class="b-cart__menu"></div>
<div class="b-cart__price">
<div class="b-cart__price-number">{{ totalPrice|price }}</div>
</div>
</div>
{% for Cart in Carts %}
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<div class="b-cart__item">
<div class="b-cart__item-image">
<img class="b-cart__item-image-pic" src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
</div>
<div class="b-cart__item-contents">
<p class="b-cart__item-name">{{ Product.name }}</p>
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
<p class="b-cart__item-class-category">{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}</p>
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<p class="b-cart__item-class-category">{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}</p>
{% endif %}
<p class="b-cart__item-price">
<span class="b-cart__item-price--main">{{ CartItem.price|price }}</span>
<span class="b-cart__item-price--sub">{{ '税込'|trans }}</span>
</p>
<p class="b-cart__item-number">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</p>
</div>
</div>
{% endfor %}
{% endfor %}
<div class="b-cart__actions">
<div class="b-cart__actions-item">
<a class="b-cart__button c-button is-secondary c-button--unelevated mdc-button mdc-button--unelevated" href="{{ url('cart') }}">
<span class="c-button__label mdc-button__label">{{ 'カートへ進む'|trans }}</span>
</a>
</div>
<div class="b-cart__actions-item">
<a class="b-cart__button c-button c-button--unelevated is-primary mdc-button mdc-button--unelevated" id="js-cart-cancel">
<span class="c-button__label mdc-button__label">{{ 'お買い物を続ける'|trans }}</span>
</a>
</div>
</div>
</div>
{% else %}
<div class="b-cart__body js-cart-target">
<div class="b-cart__heading">
<div class="b-cart__menu"></div>
<div class="b-cart__price">
<div class="b-cart__price-number">{{ totalPrice|price }}</div>
</div>
</div>
<div class="b-cart__message">
<p>{{ '現在カート内に商品はございません。'|trans }}</p>
</div>
<div class="b-cart__actions">
<div class="b-cart__actions-item">
<a class="b-cart__button c-button c-button--unelevated is-primary mdc-button mdc-button--unelevated" id="js-cart-cancel">
<span class="c-button__label mdc-button__label">{{ 'お買い物を続ける'|trans }}</span>
</a>
</div>
</div>
</div>
{% endif %}
</div>