{#
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.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'cart_page' %}
{% block main %}
<div class="ec-role">
<div class="order-navi">
<div class="ec-pageHeader">
<h1>{{ 'カゴの商品'|trans }}</h1>
</div>
<div class="ec-cartRole__progress">
<ul class="ec-progress">
{% set step = 1 %}
<li class="ec-progress__item is-complete">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">{{ '商品一覧'|trans }}
</div>
</li>
{% if is_granted('ROLE_USER') == false %}
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">{{ 'お客様情報'|trans }}
</div>
</li>
{% endif %}
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">{{ 'ご注文手続き'|trans }}
</div>
</li>
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">{{ 'ご注文内容確認'|trans }}
</div>
</li>
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">{{ '完了'|trans }}
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="ec-cartRole order-content">
<div class="content-order">
{% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
{% for error in app.session.flashbag.get('eccube.front.request.error') %}
{% set idx = loop.index0 %}
<p class="cart-error__block">
{% if productStr[idx] is defined %}
{{ error|trans({'%product%':productStr[idx]})|nl2br }}
{% else %}
{{ error|trans|nl2br }}
{% endif %}
</p>
{% endfor %}
{% for error in app.session.flashbag.get('eccube.front.cart.error') %}
<p class="cart-error__block">{{ error|trans|nl2br }}</p>
{% endfor %}
{% if totalQuantity > 0 %}
<p class="total-price">{{ '商品の合計金額は「<span class="price-number">%price%</span>」です。'|trans({ '%price%': totalPrice|price })|raw }}</p>
{% if Carts|length > 1 %}
<p class="cart-error">{{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}</p>
{% endif %}
<form name="form" id="form_cart" method="post" action="{{ url('cart') }}">
{% for CartIndex,Cart in Carts %}
{% set cartKey = Cart.cart_key %}
{% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
<p class="cart-error__block">{{ error|trans|nl2br }}</p>
{% endfor %}
<div class="content-detail">
<ul class="detail-order__list">
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<li class="detail-order__item">
<a class="button-circle btn-destructive" href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} data-method="put" data-message="カートから商品を削除してもよろしいですか?">
<img src="{{ asset('assets/icon/cross.svg') }}" alt="delete">
</a>
<div class="order-item__item">
<div class="order-item__img">
<a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">
<img src="{{ asset(Product.MainListImage|no_image_product, 'save_image') }}" alt="{{ Product.name }}"/>
</a>
</div>
<dl class="order-item__detail">
<dt>
<a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
<br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
{% endif %}
</dt>
<dd>{{ CartItem.price|price }}</dd>
</dl>
</div>
<dl class="order-item__quantity">
<dt>{{ '数量'|trans }}</dt>
<dd>
<div class="change-quantity">
{% if CartItem.quantity > 1 %}
<a href="{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="load-overlay" data-method="put" data-confirm="false">-</a>
{% else %}
<span class="btn-disabled">-</span>
{% endif %}
</div>
<span class="current-quantity">{{ CartItem.quantity|number_format }}</span>
<div class="change-quantity">
<a href="{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="load-overlay" data-method="put" data-confirm="false">+</a>
</div>
</dd>
</dl>
<dl class="order-item__subtotal">
<dt>{{ '小計'|trans }}</dt>
<dd>{{ CartItem.total_price|price }}</dd>
</dl>
</li>
{% endfor %}
</ul>
</div>
<dl class="total-amount">
<dt>{{ '合計'|trans }}</dt>
<dd>{{ Cart.totalPrice|price }}<span class="tax-label">(税・送料込み)</span></dd>
</dl>
<div class="form-unit__actions">
<a class="ec-blockBtn--action" href="{{ path('cart_buystep', {'cart_key':cartKey}) }}">{{ 'レジに進む'|trans }}</a>
{% if loop.last %}
<a class="ec-blockBtn--cancel" href="{{ path('homepage') }}">{{ 'お買い物を続ける'|trans }}</a>
{% endif %}
</div>
{% endfor %}
</form>
{% else %}
{% for CartIndex,Cart in Carts %}
{% set cartKey = Cart.cart_key %}
{% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
<div class="ec-cartRole__error">
<div class="ec-alert-warning">
<div class="ec-alert-warning__icon"><img src="{{ asset('assets/icon/exclamation-white.svg') }}"></div>
<div class="ec-alert-warning__text">
{{ error|trans|nl2br }}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
<p class="cart-error__block">{{ '現在カート内に商品はございません。'|trans }}</p>
{% endif %}
</div>
</div>
{% endblock %}