-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.php
91 lines (90 loc) · 4.68 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
<?php
require('top.php');
if (!isset($_SESSION['cart'])) {
$_SESSION['cart'] = array();
}
?>
<!-- Start Bradcaump area -->
<div class="ht__bradcaump__area" style="background: rgba(0, 0, 0, 0) url(images/bg/4.jpg) no-repeat scroll center center / cover ;">
<div class="ht__bradcaump__wrap">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="bradcaump__inner">
<nav class="bradcaump-inner">
<a class="breadcrumb-item" href="index.html">Home</a>
<span class="brd-separetor"><i class="zmdi zmdi-chevron-right"></i></span>
<span class="breadcrumb-item active">shopping cart</span>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Bradcaump area -->
<!-- cart-main-area start -->
<div class="cart-main-area ptb--100 bg__white">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<form action="#">
<div class="table-content table-responsive">
<table>
<thead>
<tr>
<th class="product-thumbnail">products</th>
<th class="product-name">name of products</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
foreach ($_SESSION['cart'] as $key => $val) {
$productArr = get_product($con, '', '', $key);
$pname = $productArr[0]['name'];
$mrp = $productArr[0]['mrp'];
$price = $productArr[0]['price'];
$image = $productArr[0]['image'];
$qty = $val['qty'];
?>
<tr>
<td class="product-thumbnail"><a href="#"><img src="<?php echo PRODUCT_IMAGE_SITE_PATH . $image ?>" /></a></td>
<td class="product-name"><a href="#"><?php echo $pname ?></a>
<ul class="pro__prize">
<li class="old__prize"><?php echo $mrp ?></li>
<li><?php echo $price ?></li>
</ul>
</td>
<td class="product-price"><span class="amount"><?php echo $price ?></span></td>
<td class="product-quantity"><input type="number" id="<?php echo $key ?>qty" value="<?php echo $qty ?>" /><br>
<a href="javascript:void(0)" onclick="manage_cart('<?php echo $key ?>','update')">Update</a>
</td>
<td class="product-subtotal"><?php echo $qty * $price ?></td>
<td class="product-remove"><a href="javascript:void(0)" onclick="manage_cart('<?php echo $key ?>','remove')"><i class="icon-trash icons"></i></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="buttons-cart--inner">
<div class="buttons-cart">
<a href="<?php echo SITE_PATH ?>">Continue Shopping</a>
</div>
<div class="buttons-cart checkout--btn">
<a href="<?php echo SITE_PATH ?>checkout.php">checkout</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<?php require('footer.php'); ?>