-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart3.html
442 lines (370 loc) · 12.5 KB
/
cart3.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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles/navbar.css">
<link rel="stylesheet" href="styles/home.css">
<script src="https://kit.fontawesome.com/c31f20646c.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="styles/main.css">
<link rel="icon" href="https://2.bp.blogspot.com/-Wg8FSK_ntCw/WIC35p13I4I/AAAAAAAAYkE/NigX0ARP108IvSehpOXk-ghVqCsKGVMnACLcB/s1600/snapdeal.jpg" type="image/icon type" style="border-radius: 30%;">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<title>Document</title>
<style>
.shopingcart1{
position: fixed;
width: 85%;
margin-left: 7.5%;
height:343px;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
margin-top: 6%;
}
.bottompay{
width:100%;
background-color: rgb(3, 3, 3);
height:100px;
position: fixed;
margin-top: 35%;
margin-left: -0.5em;
}
.shopingcart2{
display: flex;
color:rgb(77, 72, 72);
font-family: sans-serif;
font-size: 17px;
margin-left: 3%;
margin-top: 1%;
}
.shopingcart3{
font-size: 13px;
margin-top: 0.1%;
margin-left: 1%;
font-family: sans-serif;
font-stretch: semi-expanded;
color: rgb(158, 153, 153);
}
.shopingcart4{
margin-left: 80%;
cursor: pointer;
}
.shopingcart5{
display: flex;
font-size: 15px;
font-family: sans-serif;
font-stretch:wider;
color: rgb(167, 162, 162);
width:100%;
background-color: rgb(248, 245, 245);
height: 3em;
}
.shopingcart6{
margin-left:4%;
margin-top: 1%;
width:30.5%;
}
.shopingcart7{
margin-top: 1%;
margin-left: 1%;
}
.shopingcart8{
margin-top: 1%;
margin-left: 6%;
}
.shopingcart9{
margin-top: 1%;
margin-left: 6%;
}
.shopingcart10{
margin-top: 1%;
margin-left: 0.5%;
color:rgb(204, 68, 109);
}
.glyphicon{
color: black;
cursor: pointer;
}
.shopingcart11{
margin-left: 18%;
margin-top: 1%;
}
.shopingcart12{
width:100%;
overflow: auto;
height: 250px;
}
.shopingcart14{
display: flex;
height:150px;
/* border: 1px solid red; */
}
.shopingcart14>img{
width:7%;
margin-top: 2%;
margin-left: 3%;
height:80px
}
.shopingcart15{
font-size: 13px;
color:rgb(134, 131, 131);
width:20%;
margin-left: 3%;
margin-top: 2.2%;
}
.shopingcart17{
/* position: fixed; */
font-size: 15px;
margin-top: 1%;
cursor: pointer;
margin-top: 9%;
margin-left: -85%;
}
.shopingcart18{
font-size: 15px;
margin-left: 2%;
margin-top: 2.5%;
color: rgb(177, 167, 167);
}
.shopingcart19{
margin-left: 6%;
margin-top: 2%;
}
#shopingcart20{
font-size: 15px;
margin-left: 15%;
}
.shopingcart20{
font-size: 15px;
height:20px;
overflow: hidden;
width: 20%;
margin-top: 3%;
margin-left: 6%;
color: rgb(128, 120, 120);
}
.shopingcart21{
color:green;
font-size: 15px;
margin-top: 3%;
margin-left: 0%;
}
.shopingcart22{
font-size: 15px;
margin-left: 17%;
margin-top: 4%;
}
.bottompay{
color:white;
margin-top: 31%;
height:150px
}
.bottompay1{
font-size:12px;
margin-left: 9%;
margin-top: 2%;
}
.bottompay2{
color: rgb(170, 166, 166);
}
.bottompay3>img{
width: 9px;
}
.bottompay3{
color: rgb(185, 174, 174);
}
.bottom4{
width:200px;
font-size: 12px;
color: rgb(185, 174, 174);
margin-left: 10%;
margin-top: 3%;
}
.bottompay{
display: flex;
}
.bottom5{
font-size: 13px;
color: white;
margin-top: 3%;
margin-left: -1%;
}
.bottom6{
display: flex;
}
.bottom8{
color: green;
}
.bottom9{
height: 25px;
font-size: 13px;
color: white;
background-color: rgb(228, 0, 70);
border: none;
border-radius: 3px;
margin-left: 10%;
margin-top: 3%;
}
</style>
</head>
<body>
<div id="header1">
<!-- place header here -->
</div>
<div class="shopingcart1">
<div class="shopingcart2">
<p>Shopping Cart</p>
<p class="shopingcart3">(1 Item)</p>
<div class="shopingcart4" onclick="maincome()">✖</div>
</div>
<div class="shopingcart5">
<div class="shopingcart6">Item Details</div>
<div class="shopingcart7">Price</div>
<div class="shopingcart8">Quantity</div>
<div class="shopingcart9">Showing Availability at</div>
<div class="shopingcart10">521180 <span class="glyphicon glyphicon-edit"></span></div>
<div class="shopingcart11">Subtotal</div>
</div>
<div class="shopingcart12">
<!-- <div class="shopingcart14">
<img src="https://n3.sdlcdn.com/imgs/j/m/u/130x152/Saleh-Silicone-Shower-Bath-Belt-SDL405036270-1-0c211.jpg" alt="">
<div class="shopingcart15">
<p class="shopingcart16">Saleh Silicone Shower Bath Belt Back Scrubber Brush Body Scrub Foam 140 g</p>
</div>
<div class="shopingcart18">Rs.159</div>
<div class="shopingcart19">
<select name="" id="shopingcart20">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div class="shopingcart20">
Standard Delivery By Fri Mar 04 2022 12:10:26 GMT+0530 (India Standard Time)
</div>
<p class="shopingcart21">Free</p>
<p class="shopingcart22">Rs.318</p>
<p class="shopingcart17">✖ Remove</p>
</div> -->
</div>
</div>
<div class="bottompay">
<div class="bottompay1">
<p class="bottompay2">Delevery and payment options can be selected later</p>
<div class="bottompay3">
<p>  Safe and Secure Payments  </p>
  100% Payment Protection, Easy Returns Policy
</div>
</div>
<div class="bottom4">
<p>Sub Total:</p>
<p>Delivery Charges:</p>
</div>
<div class="bottom5">
<div class="bottom6">
<p>Rs.</p>
<p class="bottom7"></p>
</div>
<p class="bottom8">Free</p>
</div>
<button class="bottom9">PROCEED TO PAY Rs. <span class="bottom10"></span></button>
</div>
</body>
</html>
<script type="module">
import navbar from "/components/navBar.js"
let head = document.querySelector("#header1");
head.innerHTML = navbar();
import footerFin from "/components/footerNav.js";
let foot = document.querySelector("#expftr");
foot.innerHTML = footerFin();
let cart = document.querySelector("#cartDiv");
cart.addEventListener("click", () => {
window.location.href = "cart2.html";
});
</script>
<script>
let pay = document.querySelector(".bottom9");
pay.addEventListener("click", () => {
window.location.href = "Adress.html";
});
function maincome(){
window.location.href="Home.html"
}
// var shopingcart14=document.createElement("div");
// shopingcart14.setAttribute("class","shopingcart14");
var m=JSON.parse(localStorage.getItem("items"));
var count=0;
var move=0;
m.forEach(function(ele){
var shopingcart14=document.createElement("div");
shopingcart14.setAttribute("class","shopingcart14");
console.log(ele)
var image=document.createElement("img");
image.src=ele.image;
let shopingcart15=document.createElement("div");
shopingcart15.setAttribute("class","shopingcart15");
var shopingcart16=document.createElement("p");
shopingcart16.setAttribute("class","shopingcart16");
shopingcart16.textContent=ele.name;
var shopingcart17=document.createElement("p");
shopingcart17.setAttribute("class","shopingcart17")
shopingcart17.innerHTML="✖ Remove";
shopingcart17.addEventListener("click",main)
shopingcart15.append(shopingcart16)
var shopingcart18=document.createElement("div");
shopingcart18.setAttribute("class","shopingcart18");
shopingcart18.innerHTML=`Rs.${ele.price}`
var shopingcart19=document.createElement("div");
shopingcart19.setAttribute("class","shopingcart19");
var shopingcart20=document.createElement("select");
shopingcart20.setAttribute("id","shopingcart20");
for(var j=1;j<=10;j++){
var option=document.createElement("option");
option.value=j;
option.innerHTML=j;
shopingcart20.append(option)
}
shopingcart19.append(shopingcart20);
let nextWeek = new Date()
nextWeek.setDate(nextWeek.getDate() + 7)
console.log(nextWeek)
var shopingcart201=document.createElement("div");
shopingcart201.setAttribute("class","shopingcart20");
shopingcart201.innerHTML=`Standard Delivery By ${nextWeek} `
let shopingcart21=document.createElement("p");
shopingcart21.setAttribute("class","shopingcart21");
shopingcart21.innerHTML=" Free"
var shopingcart22=document.createElement("p");
shopingcart22.setAttribute("class","shopingcart22");
shopingcart22.innerHTML=`Rs. ${ele.price}`
count=count+ele.price
var price=ele.price;
shopingcart20.addEventListener("change",function(){
shopingcart22.innerHTML=`Rs. ${shopingcart20.value*price}`
move=move+(shopingcart20.value*price);
console.log(move);
count=count+ele.price*shopingcart20.value
document.querySelector(".bottom7").innerHTML=count;
document.querySelector(".bottom10").innerHTML=count;
localStorage.setItem("totalprice",JSON.stringify(count))
})
document.querySelector(".bottom7").innerHTML=count;
document.querySelector(".bottom10").innerHTML=count;
localStorage.setItem("totalprice",JSON.stringify(count))
shopingcart14.append(image,shopingcart15,shopingcart18,shopingcart19,shopingcart201,shopingcart21,shopingcart22,shopingcart17);
document.querySelector(".shopingcart12").append(shopingcart14);
function main(){
event.target.parentNode.remove();
alert(`${ele.name} is removed from the cart`)
}
})
console.log(count)
</script>