| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- {% extends "base.html.twig" %}
- {% block title %}
- {% if current_lang == 'en' %}Shopping Cart{% else %}Καλάθι Αγορών{% endif %} - {{ site_title }}
- {% endblock %}
- {% block extra_css %}
- <style>
- /* --- CART STYLES (DARK THEME) --- */
- .page-title { color: var(--text-main); margin-bottom: 25px; font-weight: 800; font-size: 28px; letter-spacing: -0.5px; text-transform: uppercase; }
-
- .cart-container { background: var(--panel-bg); padding: 30px; border-radius: var(--border-radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border-color); }
-
- .cart-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
- .cart-table th, .cart-table td { padding: 18px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: left; vertical-align: middle; color: var(--text-main); }
- .cart-table th { background: rgba(0,0,0,0.2); color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
- .cart-table tr:last-child td { border-bottom: none; }
-
- .thumb { width: 65px; height: 65px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
- .no-img-placeholder { width: 65px; height: 65px; background: #0f172a; display:flex; align-items:center; justify-content:center; border-radius:6px; font-size:11px; color: var(--text-muted); border: 1px solid var(--border-color); text-transform: uppercase; font-weight: bold;}
-
- .btn-remove { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); padding: 8px 15px; text-decoration: none; border-radius: 6px; font-size: 13px; font-weight: 600; transition: 0.2s; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block;}
- .btn-remove:hover { background: #ef4444; color: white; border-color: #ef4444; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);}
- .total-price-box { text-align: right; font-size: 20px; font-weight: 700; margin-bottom: 30px; color: var(--text-muted); padding: 20px; background: rgba(0,0,0,0.15); border-radius: 8px; border: 1px solid var(--border-color); }
- .total-price-box span { color: var(--primary); font-size: 28px; font-weight: 900; margin-left: 10px; }
- /* --- CHECKOUT FORM --- */
- .checkout-box { background: rgba(0,0,0,0.2); padding: 30px; border-radius: var(--border-radius); border: 1px solid var(--border-color); margin-top: 10px; }
- .checkout-box h3 { color: var(--primary); margin-top: 0; margin-bottom: 25px; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
-
- .form-group { margin-bottom: 20px; }
- .form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
- .form-group input { width: 100%; padding: 14px; background: #0f172a; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 15px; outline: none; transition: 0.2s; box-sizing: border-box; }
- .form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2); }
-
- .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
-
- .btn-checkout { background: var(--primary); color: white; border: none; padding: 16px 20px; font-size: 16px; font-weight: 800; border-radius: 6px; cursor: pointer; width: 100%; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; margin-top: 10px; }
- .btn-checkout:hover { background: var(--primary-hover); box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4); transform: translateY(-1px); }
- .empty-cart-msg { color: var(--text-muted); font-size: 16px; text-align: center; padding: 40px 0; }
- .empty-cart-msg a { color: var(--primary); font-weight: bold; text-decoration: none; border-bottom: 2px solid transparent; transition: 0.2s; }
- .empty-cart-msg a:hover { border-color: var(--primary); }
- @media (max-width: 768px) {
- .form-grid { grid-template-columns: 1fr; gap: 0; }
- .cart-table th, .cart-table td { padding: 10px 5px; font-size: 14px; }
- .thumb { width: 50px; height: 50px; }
- .btn-remove { padding: 6px 10px; font-size: 11px; }
- }
- </style>
- {% endblock %}
- {% block content %}
- <h2 class="page-title">{% if current_lang == 'en' %}Your Cart{% else %}Το Καλάθι σου{% endif %}</h2>
- <div class="cart-container">
- {% if cart_items|length > 0 %}
- <div style="overflow-x: auto;">
- <table class="cart-table">
- <thead>
- <tr>
- <th>{% if current_lang == 'en' %}Product{% else %}Προϊόν{% endif %}</th>
- <th>{% if current_lang == 'en' %}Price{% else %}Τιμή{% endif %}</th>
- <th>{% if current_lang == 'en' %}Qty{% else %}Ποσότητα{% endif %}</th>
- <th>{% if current_lang == 'en' %}Subtotal{% else %}Σύνολο{% endif %}</th>
- <th>{% if current_lang == 'en' %}Action{% else %}Ενέργεια{% endif %}</th>
- </tr>
- </thead>
- <tbody>
- {% for item in cart_items %}
- <tr>
- <td>
- <div style="display: flex; align-items: center; gap: 15px;">
- {% if item.image_path %}
- <img src="{{ item.image_path }}" class="thumb">
- {% else %}
- <div class="no-img-placeholder">No IMG</div>
- {% endif %}
- <strong style="color: var(--text-main); font-size: 15px;">{{ item.title }}</strong>
- </div>
- </td>
- <td style="color: var(--text-muted); font-weight: 500;">{{ item.price|number_format(2, ',', '.') }} €</td>
- <td style="font-weight: bold;">{{ item.quantity }}</td>
- <td><strong style="color: var(--text-main); font-size: 16px;">{{ item.subtotal|number_format(2, ',', '.') }} €</strong></td>
- <td>
- <a href="cart.php?action=remove&id={{ item.id }}" class="btn-remove">
- {% if current_lang == 'en' %}Remove{% else %}Αφαίρεση{% endif %}
- </a>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="total-price-box">
- {% if current_lang == 'en' %}Total Amount:{% else %}Συνολικό Ποσό:{% endif %}
- <span>{{ total_price|number_format(2, ',', '.') }} €</span>
- </div>
- <!-- Φόρμα Ολοκλήρωσης Παραγγελίας -->
- <div class="checkout-box">
- <h3>{% if current_lang == 'en' %}Shipping & Contact Details{% else %}Στοιχεία Αποστολής & Επικοινωνίας{% endif %}</h3>
-
- <form action="checkout.php" method="POST">
- <div class="form-grid">
- <div class="form-group">
- <label>{% if current_lang == 'en' %}Full Name *{% else %}Ονοματεπώνυμο *{% endif %}</label>
- <input type="text" name="customer_name" required>
- </div>
- <div class="form-group">
- <label>{% if current_lang == 'en' %}Email Address *{% else %}Email *{% endif %}</label>
- <input type="email" name="customer_email" required>
- </div>
- </div>
- <div class="form-grid">
- <div class="form-group">
- <label>{% if current_lang == 'en' %}Phone Number *{% else %}Τηλέφωνο Επικοινωνίας *{% endif %}</label>
- <input type="text" name="customer_phone" required>
- </div>
- <div class="form-group">
- <label>{% if current_lang == 'en' %}Shipping Address / City *{% else %}Διεύθυνση / Πόλη *{% endif %}</label>
- <input type="text" name="shipping_address" required>
- </div>
- </div>
- <button type="submit" class="btn-checkout">
- {% if current_lang == 'en' %}Place Order Now{% else %}Οριστική Υποβολή Παραγγελίας{% endif %}
- </button>
- </form>
- </div>
- {% else %}
- <div class="empty-cart-msg">
- <p>
- {% if current_lang == 'en' %}
- Your cart is completely empty. <a href="index.php">Explore the catalog</a>.
- {% else %}
- Το καλάθι σου είναι εντελώς άδειο. <a href="index.php">Εξερεύνησε τον κατάλογο</a>.
- {% endif %}
- </p>
- </div>
- {% endif %}
- </div>
- {% endblock %}
|