forked from dixonsimon/NammaRation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuccess.html
More file actions
116 lines (103 loc) · 4.35 KB
/
Copy pathsuccess.html
File metadata and controls
116 lines (103 loc) · 4.35 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="icon" type="image/png" href="images/logo.jpg"/>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/responsive.css">
<title>Namma Ration - Order Success</title>
</head>
<body>
<header>
<div class="nav-container">
<div class="logo">
<img src="images/logo-transperant.png" alt="Namma Ration Logo">
<h1>Namma Ration</h1>
</div>
<div class="nav-links">
<a href="home.html"><i class="fas fa-home"></i> Home</a>
<a href="cart.html"><i class="fas fa-shopping-cart"></i> Cart <span id="cart-count" class="cart-count"></span></a>
<a href="location.html"><i class="fas fa-map-marker-alt"></i> Location</a>
<a href="profile.html"><i class="fas fa-user"></i> Profile</a>
</div>
</div>
</header>
<div class="search-container">
<div class="search-bar">
<input type="text" placeholder="Search for products, categories, or offers...">
<div class="search-icon">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<main>
<div class="success-container">
<div class="success-icon">
<i class="fas fa-check-circle"></i>
</div>
<h1 class="success-title">Order Placed Successfully!</h1>
<p class="success-message">Thank you for your order. Your ration items will be delivered soon.</p>
<div class="order-details">
<h3>Order Details</h3>
<div id="order-details-content">
<!-- Order details will be loaded from localStorage -->
</div>
</div>
<div class="btn-container">
<a href="home.html" class="btn btn-success">Continue Shopping</a>
</div>
</div>
</main>
<footer>
<p>© 2025 Namma Ration. All rights reserved.</p>
</footer>
<script src="scripts/script.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Clear the cart
localStorage.removeItem('cart');
updateCartCount();
// Show order details
const orderDetails = document.getElementById('order-details-content');
const addressData = JSON.parse(localStorage.getItem('deliveryAddress') || '{}');
const cart = JSON.parse(localStorage.getItem('cart') || '[]');
let orderHTML = '';
if (addressData.address) {
orderHTML += `
<div class="order-info">
<p><strong>Delivery Address:</strong></p>
<p>${addressData.address}</p>
<p>PIN: ${addressData.pincode}</p>
<p>Phone: ${addressData.phone}</p>
</div>
`;
}
if (cart.length > 0) {
orderHTML += `<div class="order-items">`;
orderHTML += `<p><strong>Items:</strong></p>`;
cart.forEach(item => {
orderHTML += `
<div class="order-item">
<span>${item.name} x${item.quantity}</span>
<span>₹${item.price * item.quantity}</span>
</div>
`;
});
const total = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0);
orderHTML += `</div>`;
orderHTML += `
<div class="order-total">
<span>Total Amount:</span>
<span>₹${total}</span>
</div>
`;
} else {
orderHTML += `<p>No order details available.</p>`;
}
orderDetails.innerHTML = orderHTML;
});
</script>
</body>
</html>