-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
302 lines (300 loc) · 23.6 KB
/
checkout.php
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
<?php
include('header.php');
//prx($_SERVER);
$show='';
$payment='';
$not_login_show='';
$not_login_payment='';
$wallet_status='';
$wallet_class='';
if($totalprice<=0){
redirect(constant('FETCH_PATH').'shop');
}
if(isset($_SESSION['USER_ID'])){
if($totalprice>$wallet_amount){
$wallet_status='disabled';
$wallet_class='notactive';
}
}
if(isset($_SESSION['USER_ID'])){
$not_login_show='show';
$not_login_payment='payment';
}else{
$show='show';
$payment='payment';
}
checkout_sessions();
//prx($_SESSION);
?>
<script src="https://js.stripe.com/v3/"></script>
<div class="checkout-area pb-80 pt-100">
<div class="container">
<div class="row">
<div class="col-lg-9">
<div class="checkout-wrapper">
<div id="faq" class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><span>1.</span> <a data-toggle="collapse" data-parent="#faq" href="#payment-1">Checkout method</a></h5>
</div>
<div id="<?php echo $payment?>-1" class="panel-collapse collapse <?php echo $show?>">
<div class="panel-body">
<div class="row">
<!--<div class="col-lg-5">
<div class="checkout-register">
<div class="title-wrap">
<h4 class="cart-bottom-title section-bg-white">CHECKOUT AS A GUEST OR REGISTER</h4>
</div>
<div class="register-us">
<ul>
<li><input type="checkbox"> Checkout as Guest</li>
<li><input type="checkbox"> Register</li>
</ul>
</div>
<h6>REGISTER AND SAVE TIME!</h6>
<div class="register-us-2">
<p>Register with us for future convenience.</p>
<ul>
<li>Fast and easy checkout</li>
<li>Easy access to your order history and status</li>
</ul>
</div>
<a href="#">Apply Coupon</a>
</div>-->
</div>
<div class="col-lg-9 text-center">
<div class="checkout-login">
<div class="title-wrap">
<h4 class=" section-bg-white">LOGIN</h4>
</div>
<p class="text-left text-danger">Already have an account? </p>
<span class="text-left">Please log in below:</span>
<form class="login_form" method="post">
<div class="text-left login-form login_form">
<label >Email Address<span class="text-danger"> *</span> </label>
<input type="email" class="login_email" required>
<span class="email_message text-danger"></span>
</div>
<div class="text-left login-form">
<label >Password <span class="text-danger"> *</span></label>
<input type="password" class="login_password" required>
<span class="password_message text-danger"></span>
</div>
<div class="login-forget">
<a href="<?php echo constant('FETCH_PATH')?>forgot">Forgot your password?</a>
<p>* Required Fields</p>
</div>
<div class="checkout-login-btn">
<button type="submit" class="login_button">Login</button>
<span><a href="<?php echo constant('FETCH_PATH')?>login_register" class="checkout-register-btn">Register</a></span>
</div>
<input type="hidden" class="login_type" value="login">
<input type="hidden" class="login_checkout" value="yes">
</form>
</div>
<span class="text-left mt-4 login_message text-danger"></span>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><span>2.</span> <a data-toggle="collapse" data-parent="#faq" href="#payment-2">billing information</a></h5>
</div>
<div id="<?php echo $not_login_payment?>-2" class="panel-collapse collapse <?php echo $not_login_show?>">
<div class="panel-body">
<div class="billing-information-wrapper">
<form class="detail_form" method="post">
<div class="row">
<div class="col-lg-6 col-md-6">
<div class="billing-info">
<label>Full Name</label>
<input type="text" class="checkout_name" required onchange="detail_update()">
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="billing-info">
<label>Mobile Number</label>
<input type="text" class="checkout_mobile" required onchange="detail_update()">
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="billing-info">
<label>Email Address</label>
<input type="email" class="checkout_email" required onchange="detail_update()">
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="billing-info">
<label>Zip/Postal Code</label>
<input type="text" class="checkout_zipcode" required onchange="detail_update()">
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="billing-info">
<label>Address</label>
<input type="text" class="checkout_address" required onchange="detail_update()">
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="billing-info">
<label>city</label>
<input type="text" class="checkout_city" required onchange="detail_update()">
</div>
</div>
</div>
<div class="billing-back-btn">
<div class="billing-back">
<a href="#"><i class="ion-arrow-up-c"></i> back</a>
</div>
<div class="billing-btn">
<button type="submit" class="detail_button">Next</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><span>3.</span> <a data-toggle="collapse" data-parent="#faq" href="#payment-5">payment information</a></h5>
</div>
<div id="<?php echo $not_login_payment?>-5" class="panel-collapse collapse">
<div class="panel-body">
<form method="post" class="payment_form">
<div class="payment-info-wrapper">
<div class="ship-wrapper">
<div class="single-ship">
<input id="cod" type="radio" checked="checked" value="cod" name="checkout_payment" onchange="payment_update()">
<label for="cod">Cash on delivery</label>
</div>
<div class="single-ship">
<input id="stripe" type="radio" value="stripe" name="checkout_payment" onchange="payment_update()">
<label for="stripe">Stripe</label>
</div>
<div class="single-ship">
<input id="paytm" type="radio" value="paytm" name="checkout_payment" onchange="payment_update()">
<label for="paytm">Paytm</label>
</div>
<div class="single-ship">
<input id="wallet" <?php echo $wallet_status?> type="radio" value="wallet" name="checkout_payment" onchange="payment_update()">
<label for="wallet"><span class="<?php echo $wallet_class?>">Wallet</span></label>
<?php
if(isset($_SESSION['USER_ID'])){
if($totalprice>$wallet_amount){?>
<a href="<?php echo constant('FETCH_PATH').'wallet'?>" class="low-wallet-link">(Low amount refill your wallet)</a>
<?php }}?>
</div>
</div>
<div class="billing-back-btn">
<div class="billing-back">
<a href="#"><i class="ion-arrow-up-c"></i> back</a>
</div>
<div class="billing-btn">
<button type="submit" class="payment_button">Next</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><span>4.</span> <a data-toggle="collapse" data-parent="#faq" href="#payment-6">Order Review</a></h5>
</div>
<div id="<?php echo $not_login_payment?>-6" class="panel-collapse collapse">
<div class="panel-body">
<div class="order-review-wrapper">
<div class="order-review">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th class="width-1">Product Name/Type</th>
<th class="width-2">Price</th>
<th class="width-3">Quantity</th>
<th class="width-4">Total</th>
</tr>
</thead>
<tbody>
<?php foreach($cartarray as $list){?>
<tr>
<td>
<div class="o-pro-dec">
<p><?php echo $list['dish'].' ('.$list['attribute'].')'?></p>
</div>
</td>
<td>
<div class="o-pro-price">
<p><?php echo 'Rs '.$list['price']?></p>
</div>
</td>
<td>
<div class="o-pro-qty">
<p><?php echo $list['quantity']?></p>
</div>
</td>
<td>
<div class="o-pro-subtotal">
<p><?php echo 'Rs '.$list['price']*$list['quantity']?></p>
</div>
</td>
</tr>
<?php }?>
</tbody>
<tfoot>
<tr>
<td colspan="3"><span class="text-bold">Subtotal</span></td>
<td><b>Rs</b> <span class="text-bold total-price"><?php echo $totalprice?></span></td>
</tr>
<!--<tr class="tr-f">
<td colspan="3">Shipping & Handling (Flat Rate - Fixed</td>
<td colspan="1">Rs 45.00</td>
</tr>-->
<tr class="coupon-minus">
<td colspan="1" class="text-left">
<form method="post" class="coupon_form">
<input type="text" class="coupon-input" placeholder="Coupon Code">
<button type="submit" class="ml-10 apply_coupon">
Apply Coupon
</button>
</form>
</td>
</tr>
<tr class="coupon-final">
<td colspan="2" class="text-left coupon_message text-danger" style=" font-size: 13px;"></td>
<td ><span class="text-bold">Grand Total</span></td>
<td class="without-coupon"><span class="text-bold amount" data-amount="<?php echo $totalprice?>">Rs <?php echo $totalprice?></span></td>
</tr>
</tfoot>
</table>
</div>
<div class="billing-back-btn">
<span>
Forgot an Item?
<a href="<?php echo constant('FETCH_PATH')?>cart_page"> Edit Your Cart</a>
</span>
<div class="billing-btn">
<button type="button" onclick="place_order()" class="place_button">Place Order</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
alert('This website is for demo purpose.\nPaytm wallet test details are\n\nMobile Number: 7777777777\nPassword: Paytm1234\nOTP: 489871\n\nStripe test details are\nCard Number: 4242424242424242\nExpiry Date & CVC: Any number');
</script>
<?php
include('footer.php');?>