Repository navigation
Expand file tree
/
Copy pathcart.php
More file actions
68 lines (66 loc) · 2.86 KB
/
Copy pathcart.php
File metadata and controls
68 lines (66 loc) · 2.86 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
<?php require_once('inc/header.php'); ?>
<?php //include "handlers/product/add-to-cart.php"
?>
<!-- Header-->
<header class="bg-dark py-5">
<div class="container px-4 px-lg-5 my-5">
<div class="text-center text-white">
<h1 class="display-4 fw-bolder">Shop in style</h1>
<p class="lead fw-normal text-white-50 mb-0">With this shop homepage template</p>
</div>
</div>
</header>
<!-- Section-->
<section class="py-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="row">
<div class="col-12">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Product</th>
<th scope="col">Price</th>
<th scope="col">Quantity</th>
<th scope="col">Total</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<?php if (isset($_SESSION['cart'])): ?>
<tr>
<th scope="row">1</th>
<td><?php echo $_SESSION['cart']['name']; ?></td>
<td>$<?php echo $_SESSION['cart']['price']; ?></td>
<td>
<input type="number" value="1">
</td>
<td>$<?php echo $_SESSION['cart']['price']; ?></td>
<td>
<form action='' method='POST'>
<button type='submit' class='btn btn-danger btn-small'>Delete</button>
</form>
</td>
</tr>
<tr>
<td colspan="2">
Total Price
</td>
<td colspan="3">
<h3>$<?php echo $_SESSION['cart']['price']; ?></h3>
</td>
<td>
<a href="checkout.php" class="btn btn-primary">Checkout</a>
</td>
</tr>
<?php else: ?>
<tr>
<td colspan="6" class="text-center">Your cart is empty.</td>
</tr>
<?php endif; ?>
</table>
</div>
</div>
</div>
</section>
<?php require_once('inc/footer.php'); ?>