This repository was archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcart.php
More file actions
167 lines (158 loc) · 5.47 KB
/
cart.php
File metadata and controls
167 lines (158 loc) · 5.47 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
<!doctype html>
<html class="no-js" lang="en">
<?php
include_once 'elements\head.php';
include_once 'config\conn.php';
?>
<body>
<!-- WRAPPER START -->
<div class="wrapper bg-dark-white">
<?php include_once 'elements\header.php' ?>
<!-- HEADING-BANNER START -->
<div class="heading-banner-area overlay-bg">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="heading-banner">
<div class="heading-banner-title">
<h2>Shopping Cart</h2>
</div>
<div class="breadcumbs pb-15">
<ul>
<li><a href="index.php">Home</a></li>
<li>Shopping Cart</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- HEADING-BANNER END -->
<!-- SHOPPING-CART-AREA START -->
<div class="shopping-cart-area pt-80 pb-80">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="shopping-cart">
<!-- Nav tabs -->
<ul class="cart-page-menu nav row clearfix mb-30">
<li><a class="active" href="cart.php">shopping cart</a></li>
<li><a href="wishlist.php">wishlist</a></li>
<li><a href="checkout.php">check out</a></li>
<li><a href="order.php">order complete</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- shopping-cart start -->
<div class="tab-pane active" id="shopping-cart">
<form action="#">
<div class="shop-cart-table">
<div class="table-content table-responsive">
<table>
<thead>
<tr>
<th class="product-thumbnail">Product</th>
<th class="product-price">Price</th>
<th class="product-quantity">Quantity</th>
<th class="product-subtotal">Total</th>
<th class="product-remove">Remove</th>
</tr>
</thead>
<tbody>
<?php
if (isset($_SESSION['cart'])) {
foreach ($_SESSION['cart'] as $product) {
echo '<tr>
<td class="product-thumbnail text-left">
<!-- Single-product start -->
<div class="single-product">
<div class="product-img">
<a href="product.php?product=' . $product['id'] . '"><img
src="admin/' . $product['thumbnail'] . '" alt="" /></a>
</div>
<div class="product-info">
<h4 class="post-title"><a
class="text-light-black" href="product.php?product=' . $product['id'] . '">' . $product['name'] . '</a></h4>
<p class="mb-0">Price : ' . $product['price'] . '$</p>
<p class="mb-0">Quantity : ' . $product['quantity'] . '</p>
</div>
</div>
<!-- Single-product end -->
</td>
<td class="product-price">$' . $product['price'] . '</td>
<td class="product-quantity">' . $product['quantity'] . '</td>
<td class="product-subtotal">$' . $product['price'] * $product['quantity'] . '</td>
<td class="product-remove">
<form method="post" action="">
<input type="hidden" name="id" value="' . $product['id'] . '">
<button type="submit" name="update" class="btn"><i
class="zmdi zmdi-close"></i></button>
</form>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="customer-login payment-details mt-30">
<h4 class="title-1 title-border text-uppercase">Order details</h4>
<table>
<tbody>
<?php
// echo order details
$subTotal = $total * 0.01;
$vat = $total * 0.05;
if (isset($_SESSION['cart'])) {
foreach ($_SESSION['cart'] as $product) {
echo '<tr>
<td class="text-left">' . $product['name'] . '</td>
<td class="text-end">$' . $product['price'] * $product['quantity'] . '</td>';
}
echo '<tr>
<td class="text-left">Cart Subtotal</td>
<td class="text-end">$ ' . $subTotal . '</td>
</tr>
<tr>
<td class="text-left">Vat</td>
<td class="text-end">$ ' . $vat . '</td>
</tr>
<tr>
<td class="text-left">Cart Total</td>
<td class="text-end">$ ' . $total . '.00</td>
</tr>
<tr>
<td class="text-left">Order Total</td>
<td class="text-end">$'. $subTotal + $total + $vat .'</td>
</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
<!-- shopping-cart end -->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- SHOPPING-CART-AREA END -->
<!-- FOOTER START -->
<?php include_once 'elements\footer.php' ?>
<!-- FOOTER END -->
</div>
<!-- WRAPPER END -->
<!-- all js here -->
<?php include_once 'elements\js.php' ?>
</body>
</html>