nagasurendra commited on
Commit
8b05216
·
verified ·
1 Parent(s): b10f111

Update templates/cart.html

Browse files
Files changed (1) hide show
  1. templates/cart.html +0 -343
templates/cart.html CHANGED
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
  <!DOCTYPE html>
5
  <html lang="en">
6
  <head>
@@ -28,329 +25,6 @@
28
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
29
  }
30
 
31
-
32
- .cart-item {
33
- display: flex; /* Flexbox layout for the cart item */
34
- align-items: flex-start; /* Ensure the image and content align at the top */
35
- justify-content: space-between; /* Spread image and content across the container */
36
- border-bottom: 1px solid #e0e0e0;
37
- padding: 15px 0;
38
- }
39
-
40
- .image-wrapper {
41
- width: 80px; /* Width of the image container */
42
- height: 140px !important; /* Height of the image container */
43
- display: flex; /* Flex container for image */
44
- align-items: flex-start; /* Align the image at the top */
45
- justify-content: center; /* Center image horizontally if it has space */
46
- }
47
-
48
- .cart-item img {
49
- width: 100%; /* Fill the image container */
50
- height: auto !important; /* Maintain aspect ratio */
51
- object-fit: contain; /* Ensure the full image is visible */
52
- border-radius: 8px; /* Optional: rounded corners */
53
- transition: transform 0.3s;
54
- }
55
-
56
-
57
- .cart-item img:hover {
58
- transform: scale(1.05);
59
- }
60
- .cart-item-title {
61
- font-size: 1.1rem;
62
- font-weight: 600;
63
- }
64
- .checkout-button {
65
- background-color: #0FAA39; /* Green background */
66
- color: #fff; /* White text */
67
- padding: 12px;
68
- border-radius: 8px;
69
- border: none;
70
- width: 100%;
71
- font-size: 1.2rem;
72
- cursor: pointer;
73
- transition: background-color 0.3s, color 0.3s;
74
- }
75
-
76
- .checkout-button:hover {
77
- background-color: #0FAA39; /* Keep the background green on hover */
78
- color: #fff; /* Keep the text white on hover */
79
- }
80
-
81
- .add-back-button {
82
- padding: 6px 20px;
83
- font-size: 0.9rem;
84
- border-radius: 20px;
85
- border: 1px solid #fff;
86
- background-color: #fff;
87
- color: #0FAA39;
88
- cursor: pointer;
89
- transition: background-color 0.3s, color 0.3s;
90
- }
91
- .add-back-button:hover {
92
- background-color: #fff;
93
- color: #0FAA39;
94
- }
95
-
96
- .cart-item-details {
97
- flex: 1;
98
- margin-left: 15px;
99
- }
100
-
101
- .cart-item-quantity {
102
- display: flex;
103
- align-items: center;
104
- margin-top: 5px;
105
- }
106
- .cart-item-quantity button {
107
- width: 30px;
108
- height: 30px;
109
- border: none;
110
- background-color: #f0f0f0;
111
- font-size: 1rem;
112
- font-weight: bold;
113
- cursor: pointer;
114
- }
115
- .cart-item-quantity input {
116
- width: 40px;
117
- text-align: center;
118
- border: none;
119
- background-color: #f8f9fa;
120
- font-size: 1rem;
121
- margin: 0 5px;
122
- }
123
- .cart-summary {
124
- text-align: left;
125
- margin-top: 15px;
126
- padding: 20px;
127
- background-color: #fff;
128
- border-radius: 12px;
129
- box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
130
- }
131
-
132
- .bill-details {
133
- display: grid;
134
- grid-template-columns: 1fr 1fr; /* Two-column layout */
135
- grid-gap: 10px;
136
- margin-bottom: 10px;
137
- }
138
-
139
- .bill-details .label {
140
- font-weight: 600;
141
- font-size: 1rem;
142
- }
143
-
144
- .bill-details .amount {
145
- text-align: right;
146
- font-weight: 600;
147
- font-size: 1rem;
148
- }
149
-
150
- .dotted-line {
151
- border-bottom: 2px dotted #ccc;
152
- margin: 15px 0;
153
- }
154
-
155
- .total-bill {
156
- display: grid;
157
- grid-template-columns: 1fr 1fr;
158
- font-weight: 600;
159
- font-size: 1.2rem;
160
- margin-top: 10px;
161
- }
162
-
163
- .total-bill .label {
164
- font-size: 1.1rem;
165
- }
166
-
167
- .total-bill .amount {
168
- text-align: right;
169
- font-size: 1.1rem;
170
- color: #0FAA39; /* Green color for total */
171
- }
172
-
173
- .checkout-button {
174
- background-color: #0FAA39;
175
- color: #fff;
176
- padding: 12px;
177
- border-radius: 8px;
178
- border: none;
179
- width: 100%;
180
- font-size: 1.2rem;
181
- cursor: pointer;
182
- transition: background-color 0.3s, color 0.3s;
183
- }
184
-
185
-
186
- .suggestion-section {
187
- margin-top: 20px;
188
- padding: 15px;
189
- background-color: #f8f9fa;
190
- border-radius: 10px;
191
- }
192
- .suggestion-item {
193
- display: flex;
194
- align-items: center; /* Vertically align image and text */
195
- justify-content: space-between; /* Space between the image/text and the button */
196
- padding: 10px 0;
197
- }
198
-
199
- .suggestion-item img {
200
- width: 50px;
201
- height: 50px;
202
- object-fit: cover;
203
- border-radius: 5px;
204
- margin-right: 10px; /* Spacing between the image and the text */
205
- }
206
-
207
- .suggestion-item div {
208
- display: flex;
209
- flex-direction: column;
210
- justify-content: center;
211
- flex-grow: 1; /* Allow the text to take up the available space */
212
- }
213
-
214
- .suggestion-item button {
215
- padding: 5px 15px;
216
- font-size: 0.9rem;
217
- border-radius: 5px;
218
- border: 2px solid #0FAA39;
219
- color: #0FAA39;
220
- background-color: #fff;
221
- font-weight: 600;
222
- height: 44px;
223
- cursor: pointer;
224
- transition: background-color 0.3s, color 0.3s, border-color 0.3s;
225
- margin-left: auto; /* Push button to the right */
226
- }
227
-
228
- .suggestion-item button:hover {
229
- background-color: #0FAA39; /* Change background to green on hover */
230
- color: #fff; /* Change text color to white on hover */
231
- border-color: #0FAA39; /* Keep the border green */
232
- }
233
-
234
-
235
-
236
-
237
- .remove-icon {
238
- border: none;
239
- background: none;
240
- color: red;
241
- font-size: 1.2rem;
242
- cursor: pointer;
243
- }
244
- </style>
245
- </head>
246
- <body>
247
- <div class="container">
248
- <div class="cart-container">
249
- <div style="text-align: right;">
250
- <a href="/menu" style="text-decoration: none; font-size: 1.5rem; color: #007bff;">&times;</a>
251
- </div>
252
-
253
- <h4 class="mb-4 fw-bold">Your Cart</h4>
254
-
255
- <!-- Cart Items -->
256
- {% for item in cart_items %}
257
- <div class="cart-item">
258
- <div class="image-wrapper">
259
- <img src="{{ item.Image1__c }}" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
260
- </div>
261
- <div class="cart-item-details">
262
- <div class="cart-item-title">
263
- {{ item.Name }}
264
- </div>
265
- <div class="cart-item-addons">
266
- <small class="text-muted">Add-ons: {{ item.Add_Ons__c }}</small>
267
- </div>
268
- <div class="cart-item-instructions">
269
- <small class="text-muted">Instructions: {{ item.Instructions__c or "None" }}</small>
270
- </div>
271
- <div class="cart-item-quantity mt-2">
272
- <button onclick="updateQuantity('decrease', '{{ item.Name }}', '{{ customer_email }}')">-</button>
273
- <input type="text" value="{{ item.Quantity__c|int }}" readonly data-item-name="{{ item.Name }}">
274
- <button onclick="updateQuantity('increase', '{{ item.Name }}', '{{ customer_email }}')">+</button>
275
- </div>
276
- </div>
277
- <div class="cart-item-actions">
278
- <div>
279
- <button class="remove-icon" onclick="removeItemFromCart('{{ item.Name }}')">🗑️</button>
280
- </div>
281
- <div class="text-primary">
282
- $<span class="base-price">{{ item.Price__c }}</span>
283
- </div>
284
- </div>
285
- </div>
286
- {% else %}
287
- <p class="text-center">Your cart is empty.</p>
288
- {% endfor %}
289
-
290
- <!-- Suggestions Section -->
291
- {% if suggestions %}
292
- <div class="suggestion-section">
293
- <h5>Complete Your Meal</h5>
294
- {% for suggestion in suggestions %}
295
- <div class="suggestion-item">
296
- <img src="{{ suggestion.Image1__c }}" alt="{{ suggestion.Name }}" onerror="this.src='/static/placeholder.jpg';">
297
- <div>
298
- <div>{{ suggestion.Name }}</div>
299
- <div class="text-muted">${{ suggestion.Price__c }}</div>
300
- </div>
301
- <button class="add-back-button" onclick="addToCartSuggestion('{{ suggestion.Name }}', '{{ suggestion.Price__c }}', '{{ suggestion.Image1__c }}', '{{ suggestion.Id }}')">Add</button>
302
- </div>
303
- {% endfor %}
304
- </div>
305
- {% endif %}
306
-
307
- <!-- Subtotal -->
308
- <div class="cart-summary">
309
-
310
- {% if coupons %}
311
- <div class="coupon-selection">
312
- <label>
313
- <input type="checkbox" id="couponCheckbox" onchange="toggleCouponDropdown()">
314
- Apply Coupon Code
315
- </label>
316
- <select id="couponDropdown" class="form-select mt-2" disabled onchange="calculateDiscount()">
317
- <option value="">Select a coupon</option>
318
- {% for coupon in coupons %}
319
- <option value="{{ coupon }}">{{ coupon }}</option>
320
- {% endfor %}
321
- </select>
322
- </div>
323
- {% endif %}
324
- <div class="bill-details">
325
- <div class="label">Cart Total</div>
326
- <div class="amount">${{ subtotal }}</div>
327
- <!DOCTYPE html>
328
- <html lang="en">
329
- <head>
330
- <meta charset="UTF-8">
331
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
332
- <title>Cart</title>
333
- <!-- Bootstrap CSS -->
334
- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
335
- <style>
336
- body {
337
- font-family: Arial, sans-serif;
338
- background-color: #f3f4f6;
339
- color: #333;
340
- }
341
- .cart-container {
342
- max-width: 768px;
343
- margin: 30px auto;
344
- padding: 20px;
345
- background-color: #fff;
346
- border-radius: 12px;
347
- box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
348
- transition: box-shadow 0.3s ease-in-out;
349
- }
350
- .cart-container:hover {
351
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
352
- }
353
-
354
  .cart-item {
355
  display: flex; /* Flexbox layout for the cart item */
356
  align-items: flex-start; /* Ensure the image and content align at the top */
@@ -643,23 +317,6 @@
643
  </div>
644
  </div>
645
 
646
- <div class="amount" id="discountText">-${{ discount }}</div>
647
-
648
-
649
-
650
-
651
- </div>
652
-
653
- <div class="dotted-line"></div>
654
-
655
- <div class="total-bill">
656
- <div class="label">To Pay</div>
657
- <div class="amount" id="totalBillText">${{ subtotal }}</div>
658
- </div>
659
- <button class="checkout-button" onclick="proceedToOrder()">Proceed to Order</button>
660
- </div>
661
- </div>
662
- </div>
663
 
664
  <script>
665
  // Example function to handle the increase/decrease button clicks
 
 
 
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
 
25
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  .cart-item {
29
  display: flex; /* Flexbox layout for the cart item */
30
  align-items: flex-start; /* Ensure the image and content align at the top */
 
317
  </div>
318
  </div>
319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
 
321
  <script>
322
  // Example function to handle the increase/decrease button clicks