-
Notifications
You must be signed in to change notification settings - Fork 0
/
paymentpage.html
253 lines (208 loc) · 7.32 KB
/
paymentpage.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
<!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>Checkout</title>
<style>
body {
margin: 0;
}
/* navbar Css Start */
#navbar {
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}
#navbar>div {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 90%;
margin: auto;
}
#navbar>div>div>img {
width: 140px;
}
#navbar>div>p {
color: rgba(144, 144, 144);
}
/* navbar Css end */
/* Delivery Details CSS start */
#deli_Vol {
width: 85%;
margin: 50px auto;
display: flex;
align-items: center;
gap: 40px;
}
#deli_Vol>div:first-child {
width: 70%;
}
#deli_Vol>div:nth-child(2) {
width: 30%;
/* box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px; */
}
#deliverydetails {
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
padding: 50px;
}
#deliverydetails>div>form {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
#app_voch>div>div {
display: flex;
flex-direction: row;
}
#app_voch>div>div {
margin-bottom: 15px;
}
#app_voch>div>div>input {
width: 100%;
}
#app_voch>div>button {
width: 100%;
}
#app_voch>h2:first-child {
margin-top: -110px;
}
#app_voch>div {
box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
padding: 10px;
}
#order_sum>div {
display: flex;
justify-content: space-between;
}
#btninp {
width: 20%;
margin-left: auto;
}
/* Delivery Details CSS End */
</style>
</head>
<body>
<!-- navbar start -->
<div id="navbar">
<div>
<div>
<img src="https://pristineorganics.com/wp-content/uploads/2019/06/bigbasket-logo-png-300x200-300x200.png"
alt="">
</div>
<p>1860 123 1000</p>
</div>
</div>
<!-- navbar End -->
<!-- Addresss start -->
<div id="deli_Vol">
<div id="deliverydetails">
<h2>Delivery Details</h2>
<div>
<form id="payment-form">
<input type="text" placeholder="Full Name" id="fullname">
<input type="text" placeholder="Mobile Number" id="mobile">
<input type="text" placeholder="Emai" id="email">
<input type="text" placeholder="Delivery to Home/Office" id="home_office">
<input type="text" placeholder="Area" id="area">
<input type="text" placeholder="City" id="city">
<input type="text" placeholder="State" id="state">
<input type="number" placeholder="PinCode" id="pincode">
<h2>Payment Details</h2>
<label for=""></label>
<input type="number" placeholder="Card Number" id="card-number">
<input type="text" placeholder="Card Holder Name" id="name">
<input type="number" placeholder="CVV" id="cvv">
<input type="text" placeholder="01/25" id="expiry-date">
<label for=""></label>
<input type="Submit" id="btninp">
</form>
</div>
</div>
<div id="app_voch">
<h2>Apply Voucher</h2>
<div>
<div>
<input type="text" placeholder="Enter Voucher Code" id="promocode">
<!-- <input type="Submit" placeholder="Apply"> -->
<button onclick="applypromo()">Apply</button>
</div>
<button>6 Vouchers Available</button>
</div>
<h2>Order Summary</h2>
<div id="order_sum">
<div>
<p>Basket Value</p>
<p class="showprice">0</p>
</div>
<div>
<p>Total Amount Payable</p>
<p class="showprice">0</p>
</div>
<div>
<p>After Appling Prome Price</p>
<p id="showapplypromeprice">0</p>
</div>
</div>
</div>
</div>
<!-- Addresss End -->
</body>
</html>
<script>
var totalcartprice = localStorage.getItem("totalcartprice");
var showprice = document.querySelectorAll(".showprice");
for (var i = 0; i < showprice.length; i++) {
showprice[i].textContent = "Rs. " + totalcartprice;
}
console.log(showprice)
var form = document.getElementById("payment-form");
form.addEventListener("submit", function (event) {
event.preventDefault();
var fullname = document.getElementById("fullname").value;
var mobile = document.getElementById("mobile").value;
var email = document.getElementById("email").value;
var home_office = document.getElementById("home_office").value;
var area = document.getElementById("area").value;
var city = document.getElementById("city").value;
var state = document.getElementById("state").value;
var pincode = document.getElementById("pincode").value;
if (fullname === "" || mobile == "" || email === "" || home_office === "" || area === "" || city === "" || state === "" || pincode === "") {
alert("Fill all input fields");
return false;
}
var cardNumber = document.getElementById("card-number").value;
var cvv = document.getElementById("cvv").value;
var expiryDate = document.getElementById("expiry-date").value;
var name = document.getElementById("name").value;
var validCardNumber = "1234567890";
var validCVV = "123";
var validExpiryDate = "01/01";
if (cardNumber !== validCardNumber) {
alert("Invalid card number");
return false;
}
if (cvv !== validCVV) {
alert("Invalid CVV");
return false;
}
if (expiryDate !== validExpiryDate) {
alert("Invalid expiry date");
return false;
}
if (name.length < 1) {
alert("Invalid name");
return false;
}
window.location.href = "paymentotp.html";
return true;
});
function applypromo() {
var promocodeinput = document.getElementById("promocode").value;
if (promocodeinput === "veg30") {
totalcartprice = totalcartprice * 0.7;
}
document.getElementById("showapplypromeprice").textContent = "Rs. " + totalcartprice.toFixed(0);
}
</script>