-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder-confirmation.html
More file actions
251 lines (233 loc) · 11.2 KB
/
Copy pathorder-confirmation.html
File metadata and controls
251 lines (233 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Order Confirmation - Apple4U</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Header (same as index.html) -->
<header class="main-header">
<div class="container">
<div class="logo">
<h1><a href="index.html">Apple4U</a></h1>
</div>
<nav class="main-nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="shop.html">Shop</a></li>
<li><a href="shop.html?category=accessories">Accessories</a></li>
<li><a href="shop.html?category=macbooks">MacBooks</a></li>
<li><a href="shop.html?category=phones">Phones</a></li>
<li><a href="shop.html?category=watches">Watches</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<div class="header-icons">
<a href="#"><i class="fas fa-search"></i></a>
<a href="wishlist.html"><i class="far fa-heart"></i></a>
<a href="cart.html" class="icon-badge">
<i class="fas fa-shopping-cart"></i>
<span id="header-cart-count">0</span>
</a>
<a href="account.html"><i class="far fa-user"></i></a>
</div>
<div class="mobile-menu-toggle">
<i class="fas fa-bars"></i>
</div>
</div>
</header>
<!-- Page Header -->
<section class="page-header">
<div class="container">
<h1>Order Confirmation</h1>
<div class="breadcrumb">
<a href="index.html">Home</a>
<span class="separator">/</span>
<span class="current">Order Confirmation</span>
</div>
</div>
</section>
<!-- Confirmation Section -->
<section class="confirmation-section">
<div class="container">
<div class="confirmation-content">
<div class="confirmation-icon">
<i class="fas fa-check-circle"></i>
</div>
<h2>Thank You for Your Order!</h2>
<p class="confirmation-message">Your order has been placed successfully. We've sent you an email with your order details.</p>
<div class="order-details">
<h3>Order Details</h3>
<div class="order-info">
<div class="order-info-row">
<span>Order Number:</span>
<span id="confirmation-order-id">-</span>
</div>
<div class="order-info-row">
<span>Date:</span>
<span id="confirmation-date">-</span>
</div>
<div class="order-info-row">
<span>Total:</span>
<span id="confirmation-total">-</span>
</div>
<div class="order-info-row">
<span>Payment Method:</span>
<span>Paystack</span>
</div>
</div>
</div>
<div class="order-summary">
<h3>Order Summary</h3>
<div class="order-summary-content">
<div class="order-summary-header">
<span>Product</span>
<span>Total</span>
</div>
<div id="confirmation-items">
<!-- Order items will be loaded dynamically -->
</div>
<div class="order-summary-row subtotal">
<span>Subtotal</span>
<span id="confirmation-subtotal">-</span>
</div>
<div class="order-summary-row shipping">
<span>Shipping</span>
<span id="confirmation-shipping">-</span>
</div>
<div class="order-summary-row total">
<span>Total</span>
<span id="confirmation-order-total">-</span>
</div>
</div>
</div>
<!-- Update the confirmation actions section to make the WhatsApp button optional -->
<div class="confirmation-actions">
<a href="shop.html" class="btn btn-primary">Continue Shopping</a>
<a href="#" id="whatsapp-order" class="btn btn-outline">
<i class="fab fa-whatsapp"></i> Resend to WhatsApp
</a>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="main-footer">
<div class="container">
<div class="footer-widgets">
<div class="footer-widget">
<h3 class="footer-title">About Apple4U</h3>
<p> Apple4U is a premium destination for quality and affordable iphones, Macbboks, Apple watches, and other apple accessories like Aipods, charger, screen protectors etc.</p>
<div class="social-icons">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="footer-widget">
<h3 class="footer-title">Quick Links</h3>
<ul class="footer-links">
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact Us</a></li>
<li><a href="terms.html">Terms & Conditions</a></li>
<li><a href="privacy.html">Privacy Policy</a></li>
<li><a href="faq.html">FAQs</a></li>
</ul>
</div>
<div class="footer-widget">
<h3 class="footer-title">Categories</h3>
<ul class="footer-links">
<li><a href="shop.html?category=accessories">Accessories</a></li>
<li><a href="shop.html?category=macbooks">MacBooks</a></li>
<li><a href="shop.html?category=phones">Phones</a></li>
<li><a href="shop.html?category=watches">Watches</a></li>
<li><a href="shop.html">All Products</a></li>
</ul>
</div>
<div class="footer-widget">
<h3 class="footer-title">Contact Info</h3>
<ul class="contact-info">
<li><i class="fas fa-map-marker-alt"></i> Takoradi, Ghana</li>
<li><i class="fas fa-phone"></i><a href="tel:233554639777">+233 554639777</a></li>
<li><i class="fas fa-envelope"></i><a href="mailto:apple4u@gmail.com">apple4u@gmail.com</a>
<li><i class="fas fa-clock"></i> Monday-Friday: 9am to 5pm</li>
</ul>
</div>
</div>
<div class="footer-bottom">
<p>© 2023 Apple4U. All Rights Reserved.</p>
<div class="payment-methods">
<i class="fab fa-cc-visa"></i>
<i class="fab fa-cc-mastercard"></i>
<i class="fab fa-cc-amex"></i>
<i class="fab fa-cc-paypal"></i>
</div>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="js/products.js"></script>
<script src="js/cart.js"></script>
<script src="js/checkout.js"></script>
<!-- Update the script to reflect that WhatsApp is now sent automatically -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Get order ID from URL
const urlParams = new URLSearchParams(window.location.search);
const orderId = urlParams.get('order_id');
if (orderId) {
// Load order details
loadOrderDetails(orderId);
} else {
// Redirect to home if no order ID
window.location.href = 'index.html';
}
// WhatsApp button (now for resending)
const whatsappBtn = document.getElementById('whatsapp-order');
if (whatsappBtn) {
whatsappBtn.addEventListener('click', function(e) {
e.preventDefault();
if (orderId) {
sendOrderToWhatsApp(getOrderById(orderId));
window.productUtils.showNotification("Order details sent to WhatsApp.", "success");
}
});
}
});
// Load order details
function loadOrderDetails(orderId) {
const order = getOrderById(orderId);
if (!order) {
window.location.href = 'index.html';
return;
}
// Update order details
document.getElementById('confirmation-order-id').textContent = order.id;
document.getElementById('confirmation-date').textContent = new Date(order.date).toLocaleDateString();
document.getElementById('confirmation-total').textContent = window.productUtils.formatPrice(order.total);
// Update order items
const itemsElement = document.getElementById('confirmation-items');
let html = '';
order.items.forEach(item => {
const subtotal = item.price * item.quantity;
html += `
<div class="order-summary-item">
<span>${item.name} × ${item.quantity}</span>
<span>${window.productUtils.formatPrice(subtotal)}</span>
</div>
`;
});
itemsElement.innerHTML = html;
// Update totals
document.getElementById('confirmation-subtotal').textContent = window.productUtils.formatPrice(order.subtotal);
document.getElementById('confirmation-shipping').textContent = order.shipping === 0 ? 'Free' : window.productUtils.formatPrice(order.shipping);
document.getElementById('confirmation-order-total').textContent = window.productUtils.formatPrice(order.total);
}
</script>
</body>
</html>