{% extends "standard_tpl.html.twig" %}
{% set page_title_alt = "Cart" %}
{% block page_banner 'minimal' %}
{% block content %}
<!-- Cart -->
<section class="cart-wrapper" data-controller="cart" data-url="{{ path('shopping_cart_json') }}">
<div class="container">
{% if cart.items|length > 0 %}
<form action="{{ path('shopping_cart_update') }}" method="post" class="cart-form">
<div class="row justify-content-center">
<div class="col-lg-9">
<h2 class="checkout-form-title text-center">Shopping Cart</h2>
<div class="shopping-table-wrapper">
<table>
<thead>
<tr>
<th>Product</th>
<th class="text-center">Quantity</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody data-cart-target="cartContent">
{% for item in cart.items %}
<tr class="cart-item" data-product-id="{{ item.id }}" data-product-price="{{ item.price }}">
<td class="order-card-details">
<div class="d-flex align-items-center order-card">
<img src="{{ item.image|media_url }}" class="img-fluid" alt="{{ item.name }}">
<div class="order-card-content d-md-block">
<h3 class="order-card-title">{{ item.name }}</h3>
<p>{{ currency(item.price) }}</p>
</div>
</div>
</td>
<td class="text-center">
<div class="input-group fast-cart-group quantity-controls">
<button class="btn btn-outline-secondary" type="button" data-action="cart#decrement" data-index="{{ item.id }}">-</button>
<input type="text" name="products[{{item.id}}][qty]" data-cart-target="quantity" class="form-control checkout-form-input" type="number" aria-label="Example text with button addon" value="{{ item.qty }}">
<button class="btn btn-outline-secondary" type="button" data-action="cart#increment" data-index="{{ item.id }}">+</button>
</div>
<a href="#" class="btn-cart-remove" data-action="click->cart#removeItem" data-index="{{ item.id }}">Remove</a>
</td>
<td class="text-right" data-cart-target="total">{{ currency(item.getAmount()) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="order-summary-wrapper">
<div class="d-flex justify-content-between mt-3">
<div>
<p class="text-right">Shipping & taxes calculated at checkout</p>
</div>
<div class="subtotal">
<span class="subtotal-label">Subtotal: </span>
<span data-cart-target="subtotalAmount">{{ currency(sub_total) }}</span>
</div>
</div>
<p>All charges are billed in USD. While the content of your cart is currently displayed in , the checkout will use USD at the most current exchange rate.</p>
<p>
<input style="float:none; vertical-align: middle;" type="checkbox" class="agree_terms_conditions" />
<label style="display:inline; float:none" for="agree">
I agree with the <a href="#">terms and conditions</a>
</label>
</p>
<div class="d-flex justify-content-end mt-4 checkout-btn-list align-items-center">
<!-- <button type="submit" class="btn btn-teritary-fast">Update Cart</button> -->
<div class="col-md-3">
<a href="{{ path('shopping_checkout') }}" class="btn btn-teritary-fast btn-cart-checkout">
<span class="text">Check Out</span>
</a>
</div>
</div>
</div>
</div>
</div>
</form>
{% else %}
<div class="cart-empty-container row justify-content-center">
<div class="col-md-5">
<div class="cart-empty-content text-center">
<h2>Your cart is currently empty.</h2>
<p>Before proceed to checkout you must add some products
to your shopping cart. You will find a lot of interesting products
on our Website.
</p>
<a href="{{ path('product_list') }}" class="btn btn-teritary-fast"><span class="text">Go to shopping</span></a>
</div>
</div>
</div>
{% endif %}
<div class="spinner-wrapper" data-cart-target="spinner">
<div class="spinner"></div>
<span>Loading...</span>
</div>
</div>
</section>
<!-- Cart -->
{% endblock %}