-
Notifications
You must be signed in to change notification settings - Fork 4
/
cart_details.html
273 lines (245 loc) · 9.73 KB
/
cart_details.html
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cart Details</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/cart_details.css">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css"
integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous">
</head>
<body>
<div class="header-container">
<header>
<div class="signin-customer-care">
<ul>
<li>
<a href="#" id="username"></a>
</li>
<li onclick="showBox()">
<p id="signin">Sign In / Join AJIO</p>
</li>
<li onclick="signOut()">
<p id="signout">Sign Out</p>
</li>
<li>
<a href="#">Customer Care</a>
</li>
</ul>
</div>
<div class="logo-box">
<a href="index.html">
<img class="logo-img" src="images/Ajio-Logo.svg" alt="">
</a>
</div>
<div class="nav">
<img src="images/header/two.PNG" alt="">
</div>
</header>
</div>
<!--------------SignIn box start ---------->
<div class="sign-in-container">
<div class="sign-in-box">
<div onclick="hideBox()" class="close">X</div>
<h2 class="box-heading top">Welocome to AJIO</h2>
<h3 class="box-heading join">Join/Sign In using</h3>
<div class="link-box">
<div class="fb"><img src="images/signInBox/fb.jpg" alt=""> Facebook</div>
<div class="google"><img src="images/signInBox/google.jpg" alt=""> Google</div>
</div>
<div class="or">Or</div>
<div class="line left"></div>
<div class="line right"></div>
<h3 class="box-heading small" id="inputHeading">Enter Mobile Number*</h3>
<p id="warning"></p>
<input type="text" id="number"><br>
<div class="hide input-container" id="inputCont">
<div class="radioBox" id="radioBox">Gender:
<label>
<input type="radio" name="radio-button" value="no" />
<span>Female</span>
</label>
<label>
<input type="radio" name="radio-button" value="no" />
<span>Male</span>
</label>
</div>
<input type="text" id="name" placeholder="Name"><br>
<input type="text" id="email" placeholder="Email"><br>
<input type="password" id="password" placeholder="Password">
</div>
<button onclick="goToSignUP()" class="continue" id="continueBtn">CONTINUE</button>
<h3 class="box-heading lite">By Signing in, I agree to <span class="blue-span">Term and Conditions.</span>
</h3>
</div>
</div>
<!--------------SignIn box end ------------>
<!-- main body container starts -->
<div class="main-container">
<div class="del-address">
<div class="address-show">
<img src="images/cart_images/placeholder.png" alt="">
<div>
<div>Delivery Address</div>
<div>We will deliver your order to this address</div>
</div>
</div>
<div id="new_address"></div>
<button id="add-new-address">Add New Address</button>
</div>
<div class="total-bill">
<div class="bill">
<div>Order Details</div>
<div class="bag-total bill-card">
<div>Bag Total</div>
<div id="bag-item-amount">Rs. 950</div>
</div>
<div class="bag-delivery bill-card">
<div>Delivery</div>
<div id="bag-delivery-amount">FREE</div>
</div>
<div class="bag-total bill-card">
<div>Total Amount</div>
<div id="bag-total-amount">Rs. 950</div>
</div>
<button onclick="goToPayment()" id="proceed-to-ship">PROCEED TO PAYMENT</button>
</div>
</div>
</div>
<!-- main body container ends -->
<!-- Address add/update pop up starts -->
<div class="change_address">
<div class="container">
<h1 id="close">+</h1>
<h3>Add new address</h3>
<form>
<div class="inputbox">
<input id="input1" type="text" autocomplete="no" placeholder="Name*">
</div>
<div class="inputbox">
<input id="input2" type="number" value="Shubahm" placeholder="Mobile*">
</div>
<div class="inputbox">
<input id="input3" type="text" value="8954686319" placeholder="Pincode*">
</div>
<div class="inputbox">
<input id="input4" type="text" placeholder="Locality / Area / Street*">
</div>
<div class="inputbox">
<input id="input5" type="text" placeholder="Flat Number / Building Name*">
</div>
<div class="inputbox">
<input id="input6" type="text" placeholder="Landmark">
</div>
<div class="inputbox">
<input id="input7" type="text" placeholder="District / City*">
</div>
<div class="inputbox">
<input id="input8" type="text" placeholder="State*">
</div>
<div>
<h4>Address Type</h4>
<div>
<input type="radio"> Home
<input type="radio"> Work
<input type="radio"> Others
</div>
<div>
<input type="checkbox"> Make as default Address
</div>
</div>
</form>
<div>
<button id="button">Add</button>
<button onclick="closePage()">Save</button>
</div>
</div>
</div>
<!-- Address add/update pop up ends -->
<footer>
<div class="bottom-bar">
<div class="bottom-bar-info">
<img src="images/cart_images/secure-payment.png" alt="">
<div>SECURE PAYMENTS</div>
</div>
<div class="bottom-bar-info">
<img src="images/cart_images/rupee.png" alt="">
<div>CASH ON DELIVERY</div>
</div>
<div class="bottom-bar-info">
<img src="images/cart_images/quality.png" alt="">
<div>ASSURED QUALITY</div>
</div>
<div class="bottom-bar-info">
<img src="images/cart_images/return.png" alt="">
<div>EASY RETURNS</div>
</div>
</div>
</footer>
</body>
</html>
<script>
var btn = document.getElementById("add-new-address").addEventListener('click', function () {
document.querySelector('.change_address').style.display = 'flex'
})
let close = document.getElementById('close');
close.addEventListener('click',closePage);
function closePage(){
document.querySelector('.change_address').style.display = 'none'
}
var button = document.getElementById('button')
var new_address = document.getElementById('new_address')
var id = 0
function taking_input() {
var name = document.getElementById('input1').value
var mobile = document.getElementById('input2').value
var pincode = document.getElementById('input3').value
var locality = document.getElementById('input4').value
var flat = document.getElementById('input5').value
var landmark = document.getElementById('input6').value
var city = document.getElementById('input7').value
var state = document.getElementById('input8').value
id++
var div = document.createElement('div')
div.setAttribute('class', 'address_grid')
div.innerHTML =
`<h4>${name}</h4>
<p>${flat}, ${landmark},</p>
<p>${locality},</p>
<p>${city}, ${state},</p>
<p>India - ${pincode}</p>
<h5>Phone : ${mobile}</h5>`
if (id <= 6) {
new_address.appendChild(div)
}
}
button.addEventListener('click', taking_input)
function goToPayment() {
let loginUser = JSON.parse(localStorage.getItem('status'));
if(loginUser[0].login==true){
window.location.href = 'payment.html'
}
else{
showBox()
}
}
function final_bill() {
let data = JSON.parse(localStorage.getItem('bill'));
let total = data[0];
let del = data[1];
let total_amount = data[2];
let bag_total = document.getElementById('bag-item-amount');
let bag_del = document.getElementById('bag-delivery-amount');
let bag_final = document.getElementById('bag-total-amount');
bag_total.innerHTML = `Rs. ${total}`;
if (del != 'FREE') {
bag_del.innerHTML = `Rs. ${del}`;
}
else {
bag_del.innerHTML = `${del}`;
}
bag_final.innerHTML = `Rs. ${total_amount}`;
}
final_bill();
</script>
<script src="js/header.js"></script>