-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.php
263 lines (231 loc) · 13.3 KB
/
cart.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
<!doctype html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Yoginee - Jewellery Shop eCommerce Bootstrap 4 Template</title>
<meta name="robots" content="noindex, follow" />
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico">
<script src="https://kit.fontawesome.com/8f7c5a9c29.js" crossorigin="anonymous"></script>
<!-- CSS
============================================ -->
<!-- google fonts -->
<link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,900" rel="stylesheet">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Pe-icon-7-stroke CSS -->
<!-- <link rel="stylesheet" href="css/pe-icon-7-stroke.css"> -->
<link rel="stylesheet" href="https://template.hasthemes.com/corano/corano/assets/css/vendor/pe-icon-7-stroke.css">
<!-- Font-awesome CSS -->
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- Slick slider css -->
<link rel="stylesheet" href="css/plugins/slick.min.css">
<!-- animate css -->
<link rel="stylesheet" href="css/plugins/animate.css">
<!-- Nice Select css -->
<link rel="stylesheet" href="css/plugins/nice-select.css">
<!-- jquery UI css -->
<link rel="stylesheet" href="css/plugins/jqueryui.min.css">
<!-- main style css -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Start Header Area -->
<?php
session_start();
include "component/_navbar.php";
?>
<!-- end Header Area -->
<main>
<!-- breadcrumb area start -->
<div class="breadcrumb-area">
<div class="container">
<div class="row">
<div class="col-12">
<div class="breadcrumb-wrap">
<nav aria-label="breadcrumb">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php"><i class="fa fa-home"></i></a></li>
<li class="breadcrumb-item"><a href="shop.php">shop</a></li>
<li class="breadcrumb-item active" aria-current="page">cart</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
<!-- breadcrumb area end -->
<div id="alert"></div>
<!-- cart main wrapper start -->
<div class="cart-main-wrapper section-padding">
<div class="container">
<div class="section-bg-color">
<div class="row">
<div class="col-lg-12">
<!-- Cart Table Area -->
<div class="cart-table table-responsive">
<?php
$set = true;
$subTotalprice = 0;
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] != true) {
echo '<div class="container d-flex justify-content-center">
<h1 class = "my-2" style = "color : #c29958;">No Product in Cart</h1>
</div>';
$set = false;
} else {
$id = $_SESSION['id'];
echo ' <input type="hidden" name="" id="userid" value="' . $id . '">';
$sql = "SELECT * FROM `cartdata` WHERE userId = '$id'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
echo '<table class="table table-bordered">
<thead>
<tr>
<th class="pro-thumbnail">Thumbnail</th>
<th class="pro-title">Product</th>
<th class="pro-price">Price</th>
<th class="pro-quantity">Quantity</th>
<th class="pro-quantity">Total Price</th>
<th class="pro-remove">Remove</th>
</tr>
</thead>
<tbody>';
while ($row = mysqli_fetch_assoc($result)) {
$tp = 0;
// echo "Total Price is : ".$tp;
echo ' <tr id = "tr' . $row['productId'] . '">
<td class="pro-thumbnail"><a href="/yoginee-E-com/product-details.php?product-query=' . $row['productId'] . '"><img class="img-fluid" src="' . $row['productImage'] . '" alt="Product"/></a></td>
<td class="pro-title"><a href="/yoginee-E-com/product-details.php?product-query=' . $row['productId'] . '"">' . $row['productName'] . '</a></td>
<td class="pro-price">
<input type="hidden" id = "productprice' . $row['productId'] .'" value="' . $row['totalPrice'] . '">
₹<span > ' . $row['totalPrice'] . '</span>
</td>
<td class="pro-quantity">
<div class="">
<input type="number" maxlength="2" class = "qtyValue" id = "' . $row['productId'] .'" value="' . $row['Quantity'] . '" style = "width: 80px;
height: 35px; padding-left: 31px; border: 1.5px solid #7a787859; ">
</div>
</td>
<td class="pro-price"> ₹
<span id = "totalPrice' . $row['productId'] .'"> ' . ($row['Quantity'] * $row['totalPrice'] ). '</span>
<input type="hidden" id = "grossTotalPrice' . $row['productId'] .'" value="' . ($row['Quantity'] * $row['totalPrice'] ). '">
</td>
<td class="pro-remove"><a href="#">
<i class="fa fa-trash-o removebtn" id = "' . $row['productId'] . '"></i>
</a></td>
</tr>';
$tp = ($row['Quantity'] * $row['totalPrice']);
$subTotalprice += $tp;
$tp = 0;
}
echo ' </tbody>
</table>';
} else {
echo '<div class="container d-flex justify-content-center">
<h1 class = "my-2" style = "color : #c29958;">No Product in Cart</h1></div>';
$set = false;
}
}
?>
</div>
<!-- Cart tottal price Option -->
<?php
if ($set) {
echo '<div class="cart-update-option d-block d-md-flex justify-content-end" style="background-color: #f8f8f8;">
<div class="cart-update d-flex align-items-center justify-content-between " >
<h6 >Total</h6>
<span class="mx-5" style="color: #c29958; font-weight: 700; ">₹ <span id = "grossTotal">'.$subTotalprice.'</span></span>
<a href="checkout.php" class="btn btn-sqr">Check Out</a>
</div>
</div>';
}
?>
</div>
</div>
<!-- <div class="row">
<div class="col-lg-5 ml-auto">
<?php
if ($set) {
echo '
<div class="cart-calculator-wrapper">
<div class="cart-calculate-items">
<h6>Cart Totals</h6>
<div class="table-responsive">
<table class="table">
<tr>
<td>Sub Total</td>
<td>₹ ' . $subTotalprice . '</td>
</tr>
<tr>
<td>Shipping</td>
<td>₹ ' . $shipingPrice . '</td>
</tr>
<tr class="total">
<td>Total</td>
<td class="total-amount">₹ ' . ($subTotalprice + $shipingPrice) . '</td>
</tr>
</table>
</div>
</div>
<a href="checkout.php" class="btn btn-sqr d-block">Proceed Checkout</a>
</div> ';
}
?>
</div>
</div> -->
</div>
</div>
</div>
<!-- cart main wrapper end -->
</main>
<!-- Scroll to top start -->
<div class="scroll-top not-visible">
<i class="fa fa-angle-up"></i>
</div>
<!-- Scroll to Top End -->
<!-- footer area start -->
<?php
include "component/_footer.php";
?>
<!-- footer area end -->
<!-- Quick view modal end -->
<!-- offcanvas mini cart start -->
<!-- offcanvas mini cart end -->
<!-- JS
============================================ -->
<script src="js/modernizr-3.6.0.min.js"></script>
<!-- jQuery JS -->
<script src="js/jquery-3.6.0.min.js"></script>
<!-- Bootstrap JS -->
<script src="js/bootstrap.bundle.min.js"></script>
<!-- slick Slider JS -->
<script src="js/plugins/slick.min.js"></script>
<!-- Countdown JS -->
<script src="js/plugins/countdown.min.js"></script>
<!-- Nice Select JS -->
<script src="js/plugins/nice-select.min.js"></script>
<!-- jquery UI JS -->
<script src="js/plugins/jqueryui.min.js"></script>
<!-- Image zoom JS -->
<script src="js/plugins/image-zoom.min.js"></script>
<!-- Images loaded JS -->
<script src="js/plugins/imagesloaded.pkgd.min.js"></script>
<!-- mail-chimp active js -->
<script src="js/plugins/ajaxchimp.js"></script>
<!-- contact form dynamic js -->
<script src="js/plugins/ajax-mail.js"></script>
<!-- google map api -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCfmCVTjRI007pC1Yk2o2d_EhgkjTsFVN8"></script>
<!-- google map active js -->
<script src="js/plugins/google-map.js"></script>
<!-- Main JS -->
<script src="js/main.js"></script>
<script src="js/cart.js"></script>
<script src="js/update.js"></script>
<script src="js/remove.js"></script>
</body>
</html>