lokeshloki143 commited on
Commit
1d77a8d
·
verified ·
1 Parent(s): c4a2b4a

Update templates/cart.html

Browse files
Files changed (1) hide show
  1. templates/cart.html +104 -64
templates/cart.html CHANGED
@@ -11,7 +11,46 @@
11
  body {
12
  font-family: Arial, sans-serif;
13
  background-color: #fdf4e3; /* Updated background color */
14
- color: #333;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  .cart-container {
17
  max-width: 768px;
@@ -24,37 +63,26 @@
24
  }
25
  .cart-container2 {
26
  background-color:#FFFFFF;
27
- }
28
- /* Green Back Button styling */
29
- .back-button {
30
- position: absolute;
31
- top: 15px;
32
- left: 15px;
33
- display: inline-block;
34
- background-color: green; /* Green color */
35
- color: white;
36
- padding: 10px 20px;
37
- text-decoration: none;
38
- font-weight: bold;
39
- border-radius: 4px;
40
- z-index: 10; /* Ensure it stays above other content */
41
- }
42
- .back-button:hover {
43
- background-color: darkgreen; /* Darker green color on hover */
44
  }
45
- .cart-item {
46
  display: flex;
47
  align-items: flex-start;
48
  justify-content: space-between;
49
  border: 1px solid transparent; /* Set the border to transparent */
50
- padding: 30px 15px 15px;
51
- background-color: #fff;/* Padding for the content */
52
  box-sizing: border-box;
53
  min-height: 100px;
54
  position: relative; /* Make the cart item a reference for the absolute positioning of the remove icon */
55
- border: 1px solid #fdf4e3; /* light Orange border around each item */
56
- border-radius: 8px; /* Rounded corners for items */
57
  }
 
58
  .remove-btn {
59
  border: none; /* Remove the border around the button */
60
  background-color: transparent; /* Transparent background */
@@ -79,6 +107,7 @@
79
  outline: none; /* Remove the outline */
80
  background-color: transparent; /* Keep background transparent after clicking */
81
  }
 
82
  /* Green Color for Prices */
83
  .text-primary {
84
  color: #2e7d32; /* Green color for the prices */
@@ -96,9 +125,9 @@
96
  }
97
  /* For the image */
98
  .cart-item img {
99
- width: 100%; /* Set the width to 70px */
100
- height: 100%; /* Set the height to 70px */
101
- object-fit: contain; /* Ensure the image covers the container without stretching */
102
  border-radius: 5px; /* Optional: rounded corners */
103
  border: 1px solid #ffcc80; /* Light orange border around images */
104
  margin: 0; /* Ensure no extra space around the image */
@@ -112,19 +141,19 @@
112
  font-weight: bold; /* Make the title text bold */
113
  }
114
 
115
- .checkout-button {
116
- background-color: #ff5722; /* Full Orange color */
117
  color: #ffffff; /* White text */
118
  padding: 12px;
119
  border-radius: 8px;
120
  border: none;
121
  width: 100%;
122
- font-size: 1.2rem;
123
  cursor: pointer;
124
  transition: background-color 0.3s, color 0.3s;
125
  }
126
  .checkout-button:hover {
127
- background-color: #ff5722; /* Full Orange color on hover */
128
  color: #ffffff; /* White text on hover */
129
  }
130
  .add-back-button {
@@ -286,14 +315,14 @@
286
  margin-bottom: 80px; /* Create space below the content when dropdown is visible */
287
  }
288
  .checkout-button {
289
- background-color: #ff5722;
290
  color: #ffffff;
291
  padding: 12px;
292
  border-radius: 8px;
293
  border: none;
294
  height: 44px;
295
  width: 100%;
296
- font-size: 1.2rem;
297
  cursor: pointer;
298
  transition: background-color 0.3s, color 0.3s;
299
  display: flex;
@@ -395,45 +424,54 @@
395
  color: #FF5722; /* Orange color */
396
  font-weight: bold; /* Make it bold */
397
  }
398
-
 
 
399
  </style>
400
  </head>
401
- <body>
 
 
 
 
 
 
 
 
 
 
402
  <div class="container">
403
  <div class="cart-container">
404
  <div style="text-align: right;">
405
- <a href="/menu" style="text-decoration: none; font-size: 1.5rem; color: #007bff;">&times;</a>
406
- </div>
407
-
408
- <h4 class="mb-4 fw-bold">Your Cart</h4>
409
 
410
- <!-- Cart Items -->
411
- <div class="cart-container2">
412
- {% for item in cart_items %}
413
- <div class="cart-item">
414
- <div class="image-wrapper">
415
- <img src="{{ item.Image1__c }}" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
416
- </div>
417
- <div class="cart-item-details">
418
- <div class="cart-item-title">
419
- {{ item.Name }}
420
- </div>
421
- <div class="cart-item-addons">
422
- <small class="text-muted">Add-ons: {{ item.Add_Ons__c }}</small>
423
- </div>
424
- <div class="cart-item-instructions">
425
- <small class="text-muted">Instructions: {{ item.Instructions__c or "None" }}</small>
426
- </div>
427
- <div class="cart-item-quantity mt-2">
428
- <button onclick="updateQuantity('decrease', '{{ item.Name }}', '{{ customer_email }}')">-</button>
429
- <input type="text" value="{{ item.Quantity__c|int }}" readonly data-item-name="{{ item.Name }}">
430
- <button onclick="updateQuantity('increase', '{{ item.Name }}', '{{ customer_email }}')">+</button>
431
- </div>
432
- </div>
433
- <div class="cart-item-actions">
434
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
435
 
436
- <!-- Delete Button with Trash Icon and onclick handler -->
437
  <button type="button" class="btn btn-light text-dark remove-btn" onclick="removeItemFromCart('{{ item.Name }}')">
438
  <i class="bi bi-trash"></i>
439
  </button>
@@ -449,6 +487,7 @@
449
  {% endfor %}
450
  </div>
451
 
 
452
  <!-- Suggestions Section -->
453
  {% if suggestions %}
454
  <div class="suggestion-section">
@@ -617,7 +656,7 @@
617
  selectedCoupon = null; // Treat it as no coupon selected
618
  }
619
  // Send the selected coupon to the backend for processing
620
- fetch('/cart/checkout', {
621
  method: 'POST',
622
  headers: { 'Content-Type': 'application/json' },
623
  body: JSON.stringify({ selectedCoupon: selectedCoupon })
@@ -755,3 +794,4 @@
755
 
756
  </body>
757
  </html>
 
 
11
  body {
12
  font-family: Arial, sans-serif;
13
  background-color: #fdf4e3; /* Updated background color */
14
+ color: #333;
15
+ }
16
+ /* Top orange bar */
17
+ .top-bar {
18
+ background-color: #FF6F3C;
19
+ width: 100%;
20
+ padding: 10px 15px;
21
+ display: flex;
22
+ align-items: center;
23
+ box-sizing: border-box;
24
+ }
25
+ .back-link {
26
+ display: flex;
27
+ align-items: center;
28
+ text-decoration: none;
29
+ }
30
+ .back-arrow {
31
+ font-size: 1.8rem;
32
+ color: #000; /* Dark black */
33
+ font-weight: bold;
34
+ }
35
+ .back-label {
36
+ margin-left: 10px;
37
+ color: white;
38
+ font-weight: bold;
39
+ font-size: 1rem;
40
+ }
41
+ h1 {
42
+ color: #1C1C1C;
43
+ font-size: 1.2rem;
44
+ margin: 30px 0 15px; /* Default margin for larger screens */
45
+ text-align: center;
46
+ }
47
+ /* Title Styling: Dark Black, Centered, and Larger Size */
48
+ .order-heading {
49
+ color: #000; /* Dark black color */
50
+ font-size: 2.5rem; /* Larger font size for desktop */
51
+ font-weight: bold;
52
+ text-align: center;
53
+ margin-top: 30px; /* Spacing from the top */
54
  }
55
  .cart-container {
56
  max-width: 768px;
 
63
  }
64
  .cart-container2 {
65
  background-color:#FFFFFF;
66
+ display: flex;
67
+ flex-direction: column;
68
+ padding: 10px;
69
+
70
+
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
+ .cart-item {
73
  display: flex;
74
  align-items: flex-start;
75
  justify-content: space-between;
76
  border: 1px solid transparent; /* Set the border to transparent */
77
+ padding: 30px 15px 15px;
78
+ background-color: #fff; /* Padding for the content */
79
  box-sizing: border-box;
80
  min-height: 100px;
81
  position: relative; /* Make the cart item a reference for the absolute positioning of the remove icon */
82
+ border: 1px solid #fdf4e3; /* light Orange border around each item */
83
+ border-radius: 8px; /* Rounded corners for items */
84
  }
85
+
86
  .remove-btn {
87
  border: none; /* Remove the border around the button */
88
  background-color: transparent; /* Transparent background */
 
107
  outline: none; /* Remove the outline */
108
  background-color: transparent; /* Keep background transparent after clicking */
109
  }
110
+
111
  /* Green Color for Prices */
112
  .text-primary {
113
  color: #2e7d32; /* Green color for the prices */
 
125
  }
126
  /* For the image */
127
  .cart-item img {
128
+ width: 70px; /* Set the width to 70px */
129
+ height: 70px; /* Set the height to 70px */
130
+ object-fit: cover; /* Ensure the image covers the container without stretching */
131
  border-radius: 5px; /* Optional: rounded corners */
132
  border: 1px solid #ffcc80; /* Light orange border around images */
133
  margin: 0; /* Ensure no extra space around the image */
 
141
  font-weight: bold; /* Make the title text bold */
142
  }
143
 
144
+ .checkout-button {
145
+ background-color: #A52A2A;
146
  color: #ffffff; /* White text */
147
  padding: 12px;
148
  border-radius: 8px;
149
  border: none;
150
  width: 100%;
151
+ font-size: 1rem;
152
  cursor: pointer;
153
  transition: background-color 0.3s, color 0.3s;
154
  }
155
  .checkout-button:hover {
156
+ background-color: #A52A2A;
157
  color: #ffffff; /* White text on hover */
158
  }
159
  .add-back-button {
 
315
  margin-bottom: 80px; /* Create space below the content when dropdown is visible */
316
  }
317
  .checkout-button {
318
+ background-color: #A52A2A;
319
  color: #ffffff;
320
  padding: 12px;
321
  border-radius: 8px;
322
  border: none;
323
  height: 44px;
324
  width: 100%;
325
+ font-size: 1rem;
326
  cursor: pointer;
327
  transition: background-color 0.3s, color 0.3s;
328
  display: flex;
 
424
  color: #FF5722; /* Orange color */
425
  font-weight: bold; /* Make it bold */
426
  }
427
+
428
+
429
+ <body>
430
  </style>
431
  </head>
432
+ <!-- Top Orange Label Bar -->
433
+ <div class="top-bar">
434
+ <a href="/menu" class="back-link">
435
+ <span class="back-arrow">&#10216;</span>
436
+ <span class="back-label">Back to Menu</span>
437
+ </a>
438
+ </div>
439
+ <!-- Order History Title (centered and dark black) -->
440
+ <div class="order-heading">Your Cart</div>
441
+
442
+
443
  <div class="container">
444
  <div class="cart-container">
445
  <div style="text-align: right;">
446
+ </div>
447
+
 
 
448
 
449
+ <div class="cart-container2">
450
+ {% for item in cart_items %}
451
+ <div class="cart-item">
452
+ <div class="image-wrapper">
453
+ <img src="{{ item.Image1__c }}" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
454
+ </div>
455
+ <div class="cart-item-details">
456
+ <div class="cart-item-title">
457
+ {{ item.Name }}
458
+ </div>
459
+ <div class="cart-item-addons">
460
+ <small class="text-muted">Add-ons: {{ item.Add_Ons__c }}</small>
461
+ </div>
462
+ <div class="cart-item-instructions">
463
+ <small class="text-muted">Instructions: {{ item.Instructions__c or "None" }}</small>
464
+ </div>
465
+ <div class="cart-item-quantity mt-2">
466
+ <button onclick="updateQuantity('decrease', '{{ item.Name }}', '{{ customer_email }}')">-</button>
467
+ <input type="text" value="{{ item.Quantity__c|int }}" readonly data-item-name="{{ item.Name }}">
468
+ <button onclick="updateQuantity('increase', '{{ item.Name }}', '{{ customer_email }}')">+</button>
469
+ </div>
470
+ </div>
471
+ <div class="cart-item-actions">
 
472
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
473
 
474
+ <!-- Delete Button with Trash Icon and onclick handler -->
475
  <button type="button" class="btn btn-light text-dark remove-btn" onclick="removeItemFromCart('{{ item.Name }}')">
476
  <i class="bi bi-trash"></i>
477
  </button>
 
487
  {% endfor %}
488
  </div>
489
 
490
+
491
  <!-- Suggestions Section -->
492
  {% if suggestions %}
493
  <div class="suggestion-section">
 
656
  selectedCoupon = null; // Treat it as no coupon selected
657
  }
658
  // Send the selected coupon to the backend for processing
659
+ fetch('/checkout', {
660
  method: 'POST',
661
  headers: { 'Content-Type': 'application/json' },
662
  body: JSON.stringify({ selectedCoupon: selectedCoupon })
 
794
 
795
  </body>
796
  </html>
797
+