templates/bundles/EcommerceBundle/Main/cart.html.twig line 1

Open in your IDE?
  1. {% extends "standard_tpl.html.twig" %}
  2. {% set page_title_alt = "Cart" %}
  3. {% block page_banner 'minimal' %}
  4. {% block  content %}   
  5.    
  6.     <!-- Cart -->
  7.     <section class="cart-wrapper" data-controller="cart" data-url="{{ path('shopping_cart_json') }}">
  8.         <div class="container">
  9.             {% if cart.items|length > 0 %}
  10.             <form action="{{ path('shopping_cart_update') }}" method="post" class="cart-form">
  11.                 <div class="row justify-content-center">
  12.                     <div class="col-lg-9">
  13.                         <h2 class="checkout-form-title text-center">Shopping Cart</h2>
  14.                         <div class="shopping-table-wrapper">
  15.                             <table>
  16.                                 <thead>
  17.                                     <tr>
  18.                                         <th>Product</th>
  19.                                         <th class="text-center">Quantity</th>
  20.                                         <th class="text-right">Total</th>
  21.                                     </tr>
  22.                                 </thead>
  23.                                 <tbody data-cart-target="cartContent">
  24.                                     {% for item in cart.items %}
  25.                                     <tr class="cart-item" data-product-id="{{ item.id }}" data-product-price="{{ item.price }}">
  26.                                         <td class="order-card-details">
  27.                                             <div class="d-flex align-items-center order-card">
  28.                                                 <img src="{{ item.image|media_url }}" class="img-fluid" alt="{{ item.name }}">
  29.                                                 <div class="order-card-content d-md-block">
  30.                                                     <h3 class="order-card-title">{{ item.name }}</h3>
  31.                                                     <p>{{ currency(item.price) }}</p>
  32.                                                 </div>
  33.                                             </div>
  34.                                         </td>
  35.                                         <td class="text-center">
  36.                                             <div class="input-group fast-cart-group quantity-controls">
  37.                                                 <button class="btn btn-outline-secondary" type="button" data-action="cart#decrement" data-index="{{ item.id }}">-</button>
  38.                                                 <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 }}">
  39.                                                 <button class="btn btn-outline-secondary" type="button" data-action="cart#increment" data-index="{{ item.id }}">+</button>
  40.                                             </div>
  41.                                             <a href="#" class="btn-cart-remove"  data-action="click->cart#removeItem" data-index="{{ item.id }}">Remove</a>
  42.                                         </td>
  43.                                         <td class="text-right" data-cart-target="total">{{ currency(item.getAmount()) }}</td>
  44.                                     </tr>
  45.                                     {% endfor %}
  46.                                 </tbody>
  47.                             </table>
  48.                         </div>
  49.                         <div class="order-summary-wrapper">
  50.                             <div class="d-flex justify-content-between mt-3">
  51.                                 <div>
  52.                                     <p class="text-right">Shipping & taxes calculated at checkout</p>
  53.                                 </div>
  54.                                 <div class="subtotal">
  55.                                     <span class="subtotal-label">Subtotal: </span>
  56.                                     <span data-cart-target="subtotalAmount">{{ currency(sub_total) }}</span>
  57.                                 </div>
  58.                             </div>
  59.                             
  60.                             
  61.                             <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>
  62.                             <p>
  63.                                 <input style="float:none; vertical-align: middle;" type="checkbox" class="agree_terms_conditions" />
  64.                                 <label style="display:inline; float:none" for="agree">
  65.                                     I agree with the <a href="#">terms and conditions</a>
  66.                                 </label>
  67.                             </p>
  68.                             <div class="d-flex justify-content-end mt-4 checkout-btn-list align-items-center">
  69.                                 <!-- <button type="submit" class="btn btn-teritary-fast">Update Cart</button> -->
  70.                                     <div class="col-md-3">
  71.                                         <a href="{{ path('shopping_checkout') }}" class="btn btn-teritary-fast btn-cart-checkout">
  72.                                             <span class="text">Check Out</span>
  73.                                         </a>
  74.                                     </div>
  75.                             </div>
  76.                         </div>
  77.                     </div>
  78.                 </div>
  79.             </form>
  80.             {% else %}
  81.             <div class="cart-empty-container row justify-content-center">
  82.                 <div class="col-md-5">
  83.                     <div class="cart-empty-content text-center">
  84.                         <h2>Your cart is currently empty.</h2>
  85.                         <p>Before proceed to checkout you must add some products 
  86.                         to your shopping cart. You will find a lot of interesting products 
  87.                         on our Website.
  88.                         </p>
  89.                         <a href="{{ path('product_list') }}" class="btn btn-teritary-fast"><span class="text">Go to shopping</span></a>
  90.                     </div>
  91.                 </div>
  92.             </div>
  93.             {% endif %}
  94.             <div class="spinner-wrapper" data-cart-target="spinner">
  95.                 <div class="spinner"></div>
  96.                 <span>Loading...</span>
  97.             </div>
  98.         </div>
  99.     </section>
  100.     <!-- Cart -->
  101. {% endblock %}