-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct.php
85 lines (67 loc) · 2.94 KB
/
product.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
<?php require_once "frontend/partials/header.php" ?>
<?php require_once "config.php" ?>
<?php
if(isset($_REQUEST['id'])):
$product_id = $_REQUEST['id'];
// query for product
$sql = "SELECT * FROM products WHERE product_id='$product_id'";
$data = $connection->query($sql);
foreach($data as $product){
}
?>
<main>
<!--================Single Product Area =================-->
<div class="product_image_area">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-12">
<div class="product_img_slide owl-carousel">
<!-- product gallery image processing -->
<?php
$product_gallery = json_decode($product['gallery']);
$product_gallery_count = count($product_gallery);
for ($i=0; $i < $product_gallery_count; $i++) :
?>
<div class="single_product_img">
<img src="admin/products/func/<?php echo $product_gallery[$i]; ?>" alt="#" class="img-fluid">
</div>
<?php endfor ?>
</div>
</div>
<div class="col-lg-8">
<div class="single_product_text text-center">
<h3><?php echo $product['product_name']; ?></h3>
<p>
<?php echo $product['description'] ?>
</p>
<div class="card_area">
<div class="product_count_area">
<p>Quantity</p>
<div class="product_count d-inline-block">
<span class="product_count_item inumber-decrement"> <i class="ti-minus"></i></span>
<input class="product_count_item input-number" type="text" value="1" min="0" max="10">
<span class="product_count_item number-increment"> <i class="ti-plus"></i></span>
</div>
<p>$5</p>
</div>
<!-- add to cart -->
<div class="add_to_cart">
<a href="cart_process.php?product_id=<?php echo $product['product_id'] ?>" class="btn_3">
<span>Add to cart</span>
</a>
</div>
<!-- /add to cart -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--================End Single Product Area =================-->
</main>
<?php
else:
echo "<p class='p-4 text-center'>There is no product</p>";
endif ?>
<?php require_once 'frontend/partials/footer.php'; ?>