{#
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 stylesheet %}
<link rel="stylesheet" href="{{ asset('assets/css/cart.css', 'user_data') }}">
{% endblock %}
{% block main %}
<div class="ec-role">
<div class="ec-pageHeader">
<h1>{{ 'ショッピングカート'|trans }}</h1>
</div>
</div>
<div class="ec-cartRole">
<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">カートの<span class="common_br">商品</span></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">お客様<span class="common_br">情報</span></div>
</li>
{% endif %}
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">ご注文<span class="common_br">手続き</span></div>
</li>
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">ご注文<span class="common_br">内容確認</span></div>
</li>
<li class="ec-progress__item">
<div class="ec-progress__number">{{ step }}{% set step = step + 1 %}
</div>
<div class="ec-progress__label">完了</div>
</li>
</ul>
</div>
{% 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 %}
<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">
{% if productStr[idx] is defined %}
{{ error|trans({'%product%':productStr[idx]})|nl2br }}
{% else %}
{{ error|trans|nl2br }}
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% for error in app.session.flashbag.get('eccube.front.cart.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 %}
{% if totalQuantity > 0 %}
{% if Carts|length > 1 %}
<div class="ec-cartRole__error">
<div class="ec-alert-warning">
<div class="ec-alert-warning__text">
{{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
</div>
</div>
</div>
{% endif %}
<form name="form" id="form_cart" class="ec-cartRole" 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') %}
<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 %}
<div class="ec-cartRole__cart">
<div class="ec-cartTable">
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<ul class="ec-cartRow">
<li class="ec-cartRow__contentColumn">
<div class="ec-cartRow__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>
<div class="ec-cartRow__summary">
<div class="cart_inner_wrap01">
<div class="ec-cartRow__name">
<a target="_blank" href="{{ url('product_detail', {id : Product.id} ) }}">{{ Product.name }}</a>
<div>
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
<p>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}</p>
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<p>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}</p>
{% endif %}
</div>
</div>
<div class="ec-cartRow__unitPrice">{{ CartItem.price|price }}</div>
</div>
<div class="ec-cartRow__amount">{{ CartItem.quantity|number_format }}</div>
<div class="cart_inner_wrap02">
<div class="ec-cartRow__amountUpDown">
{% if CartItem.quantity > 1 %}
<a href="{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="ec-cartRow__amountDownButton load-overlay" data-method="put" data-confirm="false">
<i class="fas fa-minus-circle"></i>
</a>
{% else %}
<div class="ec-cartRow__amountDownButtonDisabled">
<i class="fas fa-minus-circle"></i>
</div>
{% endif %}
<div class="ec-cartRow__amountSP"><span>数量</span>{{ CartItem.quantity|number_format }}</div>
<a href="{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}" {{ csrf_token_for_anchor() }} class="ec-cartRow__amountUpButton load-overlay" data-method="put" data-confirm="false">
<i class="fas fa-plus-circle"></i>
</a>
</div>
<div class="ec-cartRow__sutbtotalSP"><span>{{ '小計'|trans }}</span>{{ CartItem.total_price|price }}</div>
</div>
<div class="ec-cartRow_delete">
<a href="{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}" {{ csrf_token_for_anchor() }} class="ec-icon" data-method="put" data-message="カートから商品を削除してもよろしいですか?">
<i class="fas fa-times"></i>
</a>
</div>
</div>
</li>
<li class="ec-cartRow__subtotalColumn">
<div class="ec-cartRow__sutbtotal">{{ CartItem.total_price|price }}</div>
</li>
</ul>
{% endfor %}
</div>
</div>
<div class="ec-cartRole__progress">
{% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
{% if is_delivery_free[cartKey] %}
{{ '現在送料無料です!'|trans }}
{% else %}
{{ 'あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買上げで送料無料になります!'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
{% endif %}
{% elseif BaseInfo.delivery_free_amount %}
{% if is_delivery_free[cartKey] %}
{{ '現在送料無料です!'|trans }}
{% else %}
{{ 'あと <strong>%price%</strong> のお買上げで送料無料になります!'|trans({ '%price%': least[cartKey]|price })|raw }}
{% endif %}
{% elseif BaseInfo.delivery_free_quantity %}
{% if is_delivery_free[cartKey] %}
{{ '現在送料無料です!'|trans }}
{% else %}
{{ 'あと「<strong>%quantity%個</strong>」のお買上げで送料無料になります!'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
{% endif %}
{% endif %}
</div>
<div class="ec-cartRole__actions">
<div class="ec-cartRole__total">{{ '合計'|trans }}<span class="ec-cartRole__totalAmount">{{ Cart.totalPrice|price }}</span>
</div>
<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 %}
<div class="ec-role">
<div class="ec-off3Grid">
<div class="ec-off3Grid__cell">
<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">{{ '現在カート内に商品はございません。'|trans }}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}