-
Notifications
You must be signed in to change notification settings - Fork 0
/
wishlist.php
58 lines (52 loc) · 2.7 KB
/
wishlist.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
<?php include 'config.php'; ?>
<?php include 'header.php'; ?>
<div class="product-wishlist-container">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="section-head">My Wishlist</h2>
<?php
if(isset($_COOKIE['user_wishlist']) && !empty($_COOKIE['user_wishlist'])){
$pid = array();
$pid = json_decode($_COOKIE['user_wishlist']);
if(is_object($pid)){
$pid = get_object_vars($pid);
}
$pids = implode(',',$pid);
$db = new Database();
$db->select('products','*',null,"product_id IN ({$pids})",null,null);
$result = $db->getResult();
if(count($result) > 0){ ?>
<table class="table table-bodered">
<thead>
<th>Product Image</th>
<th>Product Name</th>
<th>Product Price</th>
<th>Action</th>
</thead>
<tbody>
<?php foreach($result as $row){ ?>
<tr>
<td><img src="product-images/<?php echo $row['featured_image']; ?>" alt="" width="100px" /></td>
<td><?php echo $row['product_title']; ?></td>
<td><?php echo $cur_format; ?> <?php echo $row['product_price']; ?></td>
<td>
<a class="btn btn-sm btn-primary remove-wishlist-item" href="" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-remove"></i></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<a class="btn btn-sm btn-primary proceed-to-cart" href="javascript:void(0)" >Proceed to Cart</a>
<?php }
}else{ ?>
<div class="empty-result">
No products were added to the wishlist.
</div>
<?php } ?>
<?php //} ?>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>