-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyntrapayment.html
More file actions
544 lines (516 loc) · 18.9 KB
/
myntrapayment.html
File metadata and controls
544 lines (516 loc) · 18.9 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
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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!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">
<title>PAYMENT</title>
<style>
body{
margin: 0px;
width: 100%;
}
#carlayout{
flex-wrap: wrap;
}
#cartheader{
height: 78px;
width: 100%;
border-bottom: 1px solid #F5F5F6;
}
#cartnavbar{
width: 93%;
margin: auto;
height: 100%;
display: flex;
font-size: 12px;
font-weight: 600;
letter-spacing: 3px;
}
#cartmyntralogo{
height: 100%;
width: 20%;
padding-top: 10px;
padding-left: 3px;
margin: auto;
}
#cartcheckout_position{
height: 100%;
width: 50%;
color: #696B79;
display: flex;
justify-content: center;
line-height: 78px;
margin-left: 7%;
margin-top: 0px;
}
.cartstep1{
margin-right: 3px;
}
.cartstep2{
margin-left: 3px;
margin-right: 3px;
}
.cartstep3{
color: #20BD99;
border-bottom: 2px solid #20BD99;
margin-left: 3px;
}
#cartsecure{
height: 100%;
width: 30%;
display: flex;
justify-content: end;
color: #696B79;
}
#cartsecure *{
margin-top: 20px;
}
#cartfooter{
height: 50px;
width: 100%;
border-top: 1px solid #F5F5F6;
justify-content: flex-end;
}
#cartfooter>#cartfooternavbar{
width: 80%;
margin: auto;
display: flex;
}
#cartfooter #cartimages{
width: 80%;
margin: auto;
}
#cartfooter #carthelpcenter{
font-size: 16px;
font-weight: 800;
color: black;
width: 20%;
margin: auto;
}
/*cart body*/
#cartproducts{
width: 100%;
margin-bottom: 15px;
}
#cartproducts>#emptycart{
width: 40%;
margin: auto;
text-align: center;
}
#cartproducts>#emptycart>div{
height: 650px;
}
#emptycart img{
height: 150px;
margin-top: 30%;
}
#emptycart h3{
font-weight: 600;
}
#emptycart p{
color: #696B79;
margin-top: -10px;
}
#emptycart button{
color: #ff3f6c;
border: 1px solid #ff3f6c;
background-color: #fff;
font-weight: 600;
height: 35px;
cursor: pointer;
}
#cartproducts>.div{
width: 80%;
height: 100%;
margin: auto;
display: flex;
}
.div>.show{
width: 60%;
padding: 30px 20px 10px 10px;
border-right: 2px solid #F5F5F6;
flex-wrap: wrap;
}
.show>.delivery{
margin-bottom: 20px;
height: 65px;
border-radius: 5px;
display: flex;
border: 2px solid #F5F5F6;
}
.delivery>.textdiv{
font-weight: 800;
width: 70%;
margin-left: 15px;
}
.delivery>.btndiv *{
color: #ff3f6c;
border: 1px solid #ff3f6c;
background-color: #fff;
font-weight: 600;
margin-top: 15px;
height: 60%;
margin-right: 0;
cursor: pointer;
}
.btndiv>button:hover{
background-color: rgb(255, 235, 240);
}
.show>.offer{
margin-bottom: 20px;
padding-left: 20px;
border: 2px solid #F5F5F6;
border-radius: 5px;
}
.show>.products{
margin-bottom: 20px;
padding: 0 5px 10px 0;
display: flex;
border: 1px solid #ccccd8;
}
.show>.products>.options{
width: 30%;
text-align: center;
background-color: #ffffffdc;
}
.show>.products>.options>div{
height: 67px;
border: 1px solid #ccccd8;
background-color: #e2e2eb;
font-weight: 900;
color: #424553;
}
.show>.products>.pay{
width: 70%;
height: 200px;
display: grid;
}
.show>.products>.pay button{
height: 40px;
border: 0ch;
border-radius: 10px;
background-color: #ff3f6c;
color: #F5F5F6;
}
.show>.products>.pay button:hover{
cursor: pointer;
background-color: rgb(172, 84, 168);
}
.calculation>.price{
padding: 10px 0 15px 15px;
border-top: 2px solid #F5F5F6;
height: 300px;
width: 100%;
font-size: 15px;
}
.calculation>.price>:first-child{
font-weight: 500;
color: #696B79;
font-size: 20px;
}
.calculation>.price{
color: #696B79;
}
.calculation>.price>:nth-child(3)>:nth-child(2){
color: #20BD99;
}
.calculation>.price>div{
height: 15%;
width: 100%;
display: flex;
}
.calculation>.price>div>div{
height: 15%;
width: 50%;
}
.calculation>.price>:nth-last-child(1){
height: 15%;
width: 100%;
font-weight: 600;
border-top: 2px solid #696B79;
}
#modal{
background-color: #fff;
width: 400px;
height: 100px;
max-height: 80%;
max-width: 80%;
justify-items: center;
margin: auto;
}
#modal>button:hover{
cursor: pointer;
background-color: rgba(235, 235, 132, 0.918);
}
#modal-container{
height: 400px;
width: 70%;
margin: auto;
text-align: center;
align-items: center;
color: crimson;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
opacity: 0;
pointer-events: none;
background: rgba(0,0,0,0.6);
}
.active{
opacity: 5;
}
ul>h4,ul>h5{
color: #ff3f6c;
}
@media screen and (max-width: 768px){
#cartcheckout_position{
display: none;
}
#cartsecure{
margin-left: 40%;
}
}
</style>
</head>
<body>
<div id="cartlayout">
<div id="cartheader">
<div id="cartnavbar">
<div id="cartmyntralogo">
<img style="height:60%" src="https://images.assettype.com/afaqs%2F2021-01%2F15f5f827-8e29-4520-af8d-a0f353b8da17%2Fimages.png?auto=format%2Ccompress&w=1200" alt="myntra">
</div>
<div id="cartcheckout_position">
<p class="cartstep1">BAG</p>
<p>-------</p>
<p class="cartstep2">ADDRESS</p>
<p>-------</p>
<p class="cartstep3">PAYMENT</p>
</div>
<div id="cartsecure">
<img style="margin-right:5px" src="https://constant.myntassets.com/checkout/assets/img/sprite-secure.png" width="26" height="28">
<div class="cartpercent" style="margin-top:30px">100% SECURE</div>
</div>
</div>
</div>
<div id="cartproducts">
<div id="modal-container">
<div id="modal">
<h1>Order Confirmed</h1>
<button>close</button>
</div>
</div>
</div>
<div id="cartfooter">
<div id="cartfooternavbar">
<div id="cartimages">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-ssl.png" width="70" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-visa.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-mc.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-ae.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-dc.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-nb.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-cod.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-rupay.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-paypal.png" width="60" height="37">
<img src="https://constant.myntassets.com/checkout/assets/img/footer-bank-bhim.png" width="60" height="37">
</div>
<div id="carthelpcenter">
<p>Need Help? Contact Us</p>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
var cartproducts=JSON.parse(localStorage.getItem("cart_object_imgs"))||[]
if(cartproducts.length==0){
var div=document.createElement("div")
var emptylogo=document.createElement("img")
emptylogo.setAttribute("src","https://constant.myntassets.com/checkout/assets/img/empty-bag.webp")
var h2=document.createElement("h3")
h2.innerText="Hey, it feels so light!"
var p=document.createElement("p")
p.innerText="There is nothing in your bag. Let's add some items"
var btn=document.createElement("button")
btn.innerText="ADD ITEMS FROM WISHLIST"
div.append(emptylogo,h2,p,btn)
document.getElementById("emptycart").append(div)
}
else{
var div1=document.createElement("div")
div1.setAttribute("class","div")
var show=document.createElement("div")
show.setAttribute("class","show")
var offer=document.createElement("div")
offer.setAttribute("class","offer")
var h3=document.createElement("h3")
h3.innerText="Available Offers"
var ul=document.createElement("ul")
var l1=document.createElement("li")
l1.innerText="10% Instant Discount on Bank of Baroda Credit Cards on a min spend of Rs 3,000. TCA"
var l2=document.createElement("li")
l2.innerText="5% Unlimited Cashback on Flipkart Axis Bank Credit Card. TCA"
var l3=document.createElement("li")
l3.innerText="10% Cashback upto Rs 150 on Ola Money Postpaid or wallet transaction on a min spend of Rs 1000 . TCA"
var h4=document.createElement("h4")
h4.innerText="See More >"
h4.addEventListener("click",more)
ul.append(l1,l2,l3,h4)
offer.append(h3,ul)
var h4=document.createElement("h4")
h4.innerText="Choose Payment Method"
var products=document.createElement("div")
products.setAttribute("class","products")
var options=document.createElement("div")
var cash=document.createElement("div")
cash.innerText="Cash On Delivery"
cash.addEventListener("click",cod)
var card=document.createElement("div")
card.innerText="Credit/Debit Card"
card.addEventListener("click",debit)
var upi=document.createElement("div")
upi.innerText="UPI"
upi.addEventListener("click",upit)
options.append(cash,card,upi)
options.setAttribute("class","options")
var pay=document.createElement("div")
pay.setAttribute("class","pay")
products.append(options,pay)
show.append(offer,h4,products)
var calculation=document.createElement("div")
calculation.setAttribute("class","calculation")
var price=document.createElement("div")
price.setAttribute("class","price")
docalculation()
calculation.append(price)
div1.append(show,calculation)
document.getElementById("cartproducts").append(div1)
}
function displayproducts(){
cartproducts.map(function(ele){
var div=document.createElement("div")
var div1=document.createElement("div")
var div2=document.createElement("div")
var div3=document.createElement("div")
div.setAttribute("class","productdiv");
var image=document.createElement("img");
image.setAttribute("src",ele.image_url);
div1.append(image)
var h5=document.createElement("h5")
h5.innerText=ele.name;
var price=document.createElement("p")
price.innerText=ele.price;
div2.append(h5,price)
var h6=document.createElement("h5")
h6.innerText="X";
div3.append(h6)
div.append(div1,div2,div3)
products.append(div)
})
}
function docalculation(){
var total=cartproducts.reduce(function(acc,el){
return acc+el.discPrice;
},0)
var total1=cartproducts.reduce(function(acc,el){
return acc+el.price;
},0)
var total3=total1-total
var div1=document.createElement("div")
div1.innerText="Price Details"+" ("+cartproducts.length+" Items)"
var div2=document.createElement("div")
var div21=document.createElement("div")
div21.innerText="Total MRP"
var div22=document.createElement("div")
div22.innerText="₹ "+total1
div2.append(div21,div22)
var div3=document.createElement("div")
var div31=document.createElement("div")
div31.innerText="Discount on MRP"
var div32=document.createElement("div")
div32.innerText="- ₹ "+total3
div3.append(div31,div32)
var div4=document.createElement("div")
var div41=document.createElement("div")
div41.innerText="Coupon Discount"
var div42=document.createElement("div")
div42.innerText="₹ 0"
div4.append(div41,div42)
var div6=document.createElement("div")
var div61=document.createElement("div")
div61.innerText="Total Amount"
var div62=document.createElement("div")
div62.innerText="₹"+total
div6.append(div61,div62)
price.append(div1,div2,div3,div4,div6)
}
var modalcontainer=document.querySelector(".modal-container")
function cod(){
pay.innerText=""
var check=document.createElement("button")
check.innerText="PLACE ORDER"
pay.append(check)
}
function debit(){
pay.innerText=""
var check1=document.createElement("button")
check1.innerText="Credit Card"
var check2=document.createElement("button")
check2.innerText="Debit ard"
pay.append(check1,check2)
}
function upit(){
pay.innerText=""
var check1=document.createElement("button")
check1.innerText="Paytm"
check1.addEventListener("click",function(){
alert("Your Order Is Placed")
})
var check2=document.createElement("button")
check2.innerText="Phonepe"
check2.addEventListener("click",function(){
alert("Your Order Is Placed")
})
var check3=document.createElement("button")
check3.innerText="Google Pay"
check3.addEventListener("click",function(){
alert("Your Order Is Placed")
})
pay.append(check1,check2,check3)
}
function less(){
ul.innerText=""
var l1=document.createElement("li")
l1.innerText="10% Instant Discount on Bank of Baroda Credit Cards on a min spend of Rs 3,000. TCA"
var l2=document.createElement("li")
l2.innerText="5% Unlimited Cashback on Flipkart Axis Bank Credit Card. TCA"
var l3=document.createElement("li")
l3.innerText="10% Cashback upto Rs 150 on Ola Money Postpaid or wallet transaction on a min spend of Rs 1000 . TCA"
var l4=document.createElement("li")
var h5=document.createElement("h4")
h5.innerText="See More >"
h5.addEventListener("click",more)
ul.append(l1,l2,l3,h5)
}
function more(){
ul.innerText=""
var l1=document.createElement("li")
l1.innerText="10% Instant Discount on Bank of Baroda Credit Cards on a min spend of Rs 3,000. TCA"
var l2=document.createElement("li")
l2.innerText="5% Unlimited Cashback on Flipkart Axis Bank Credit Card. TCA"
var l3=document.createElement("li")
l3.innerText="10% Cashback upto Rs 150 on Ola Money Postpaid or wallet transaction on a min spend of Rs 1000 . TCA"
var l4=document.createElement("li")
l4.innerText="10% Cashback upto Rs 150 on Freecharge Paylater transaction. TCA"
var l5=document.createElement("li")
l5.innerText="5% Cashback upto Rs 100 on a minimum spend of Rs 1,500 with PayZapp. TCA"
var h4=document.createElement("h4")
h4.innerText="See Less >"
h4.addEventListener("click",less)
ul.append(l1,l2,l3,l4,l5,h4)
}
</script>