-
Notifications
You must be signed in to change notification settings - Fork 1
/
popular_products.php
60 lines (55 loc) · 2.9 KB
/
popular_products.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
<?php include 'config.php'; ?>
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="images/favicon-icon/24x24.png">
</head>
<body>
</body>
</html>
<?php include 'header.php'; ?>
<div class="product-section content">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="section-head">Popular Products</h2>
<?php
$limit = 8;
$db = new Database();
$db->select('products','*',null,'product_views > 0 AND product_status = 1 AND qty > 0','product_views DESC',$limit);
$result = $db->getResult();
if(count($result) > 0){
foreach($result as $row){ ?>
<div class="col-md-3 col-sm-6">
<div class="product-grid">
<div class="product-image latest">
<a class="image" href="single_product.php?pid=<?php echo $row['product_id']; ?>">
<img class="pic-1" src="product-images/<?php echo $row['featured_image']; ?>">
</a>
<div class="product-button-group">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>" ><i class="fa fa-eye"></i></a>
<a href="" class="add-to-cart" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-shopping-cart"></i></a>
<a href="" class="add-to-wishlist" data-id="<?php echo $row['product_id']; ?>"><i class="fa fa-heart"></i></a>
</div>
</div>
<div class="product-content">
<h3 class="title">
<a href="single_product.php?pid=<?php echo $row['product_id']; ?>"><?php echo $row['product_title']; ?></a>
</h3>
<div class="price"><?php echo $cur_format; ?> <?php echo $row['product_price']; ?></div>
</div>
</div>
</div>
<?php }
}
?>
</div>
<div class="col-md-12">
<div class="pagination-outer">
<?php echo $db->pagination('products',null,'product_views > 0 AND product_status = 1 AND qty > 0',$limit); ?>
</div>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>