Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +48 -39
templates/cart.html
CHANGED
|
@@ -7,6 +7,14 @@
|
|
| 7 |
<!-- Bootstrap CSS -->
|
| 8 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
body {
|
| 11 |
font-family: Arial, sans-serif;
|
| 12 |
background-color: #f3f4f6;
|
|
@@ -352,47 +360,48 @@
|
|
| 352 |
<h4 class="mb-4 fw-bold">Your Cart</h4>
|
| 353 |
|
| 354 |
<!-- Cart Items -->
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
</div>
|
| 391 |
-
|
|
|
|
|
|
|
|
|
|
| 392 |
</div>
|
| 393 |
-
|
| 394 |
-
<p class="text-center">Your cart is empty.</p>
|
| 395 |
-
{% endfor %}
|
| 396 |
|
| 397 |
<!-- Suggestions Section -->
|
| 398 |
{% if suggestions %}
|
|
|
|
| 7 |
<!-- Bootstrap CSS -->
|
| 8 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
<style>
|
| 10 |
+
.cart-container {
|
| 11 |
+
border-radius: 10px; /* Set the corner radius for the container */
|
| 12 |
+
border: 2px solid #ccc; /* Add a stroke (border) around the container, change the color as needed */
|
| 13 |
+
background-color: #f9f9f9; /* Set a background color */
|
| 14 |
+
padding: 15px; /* Add padding inside the container */
|
| 15 |
+
box-sizing: border-box; /* Ensure padding is included in the total width/height calculation */
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
body {
|
| 19 |
font-family: Arial, sans-serif;
|
| 20 |
background-color: #f3f4f6;
|
|
|
|
| 360 |
<h4 class="mb-4 fw-bold">Your Cart</h4>
|
| 361 |
|
| 362 |
<!-- Cart Items -->
|
| 363 |
+
<div class="cart-container">
|
| 364 |
+
{% for item in cart_items %}
|
| 365 |
+
<div class="cart-item">
|
| 366 |
+
<div class="image-wrapper">
|
| 367 |
+
<img src="{{ item.Image1__c }}" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
|
| 368 |
+
</div>
|
| 369 |
+
<div class="cart-item-details">
|
| 370 |
+
<div class="cart-item-title">
|
| 371 |
+
{{ item.Name }}
|
| 372 |
+
</div>
|
| 373 |
+
<div class="cart-item-addons">
|
| 374 |
+
<small class="text-muted">Add-ons: {{ item.Add_Ons__c }}</small>
|
| 375 |
+
</div>
|
| 376 |
+
<div class="cart-item-instructions">
|
| 377 |
+
<small class="text-muted">Instructions: {{ item.Instructions__c or "None" }}</small>
|
| 378 |
+
</div>
|
| 379 |
+
<div class="cart-item-quantity mt-2">
|
| 380 |
+
<button onclick="updateQuantity('decrease', '{{ item.Name }}', '{{ customer_email }}')">-</button>
|
| 381 |
+
<input type="text" value="{{ item.Quantity__c|int }}" readonly data-item-name="{{ item.Name }}">
|
| 382 |
+
<button onclick="updateQuantity('increase', '{{ item.Name }}', '{{ customer_email }}')">+</button>
|
| 383 |
+
</div>
|
| 384 |
+
</div>
|
| 385 |
+
<div class="cart-item-actions">
|
| 386 |
+
<div>
|
| 387 |
+
<button class="remove-icon" onclick="removeItemFromCart('{{ item.Name }}')">
|
| 388 |
+
<!-- SVG Recycle Bin Icon -->
|
| 389 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
| 390 |
+
<path d="M6 19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V7H6V19ZM8 3C8 2.45 8.45 2 9 2H15C15.55 2 16 2.45 16 3V5H8V3Z" fill="none" stroke="black" stroke-width="2"/>
|
| 391 |
+
</svg>
|
| 392 |
+
</button>
|
| 393 |
+
</div>
|
| 394 |
+
<div class="text-primary" style="color: #000 !important;">
|
| 395 |
+
$<span class="base-price">{{ item.Price__c }}</span>
|
| 396 |
+
</div>
|
| 397 |
+
</div>
|
| 398 |
</div>
|
| 399 |
+
{% else %}
|
| 400 |
+
<!-- Code to handle the case when cart_items is empty -->
|
| 401 |
+
<p>No items in your cart.</p>
|
| 402 |
+
{% endfor %}
|
| 403 |
</div>
|
| 404 |
+
|
|
|
|
|
|
|
| 405 |
|
| 406 |
<!-- Suggestions Section -->
|
| 407 |
{% if suggestions %}
|