-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewArrivals.php
61 lines (59 loc) · 3.3 KB
/
newArrivals.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
<?php
require_once 'pageContent.php';
require_once 'page.php';
class newArrivals extends pageContent
{
public function __construct(){
$this->protected_page = false;
}
public function show_content(){
$products = get_products();
if (!empty($products)):
?>
<section class="py-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center">
<?php foreach ($products as $product): ?>
<?php
if($product['new_arrival']==1):
?>
<div class="col mb-5">
<div class="card h-100">
<?php
if($product['sale']==1 and $product['old_price']==0):
?>
<div class="badge bg-dark text-white position-absolute" style="top: 0.5rem; right: 0.5rem">Скоро в продаже</div>
<?php
elseif ($product['sale'] == 1):
?>
<div class="badge bg-dark text-white position-absolute" style="top: 0.5rem; right: 0.5rem">Sale</div>
<?php endif; ?>
<a href="<?=$product['page']?>"><img class="card-img-top" src="img/<?=$product['img']?>" alt="..." /></a>
<div class="card-body p-4">
<div class="text-center">
<h5 class="fw-bolder"><a href="<?=$product['page']?>" style="text-decoration: none;color: rgba(var(--bs-black-rgb), var(--bs-text-opacity)) !important; "><?=$product['name']?></a></h5>
<?php
if($product['sale'] == 1 and !($product['old_price']==0)):
?>
<span class="text-muted text-decoration-line-through">$<?=$product['old_price']?></span>
<?php endif; ?>
$<?=$product['price']?>
</div>
</div>
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-outline-dark mt-auto add-to-cart" href="?cart=add&id=<?= $product['id'] ?>" data-id="<?= $product['id'] ?>">Добавить в корзину</a></div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
</section>
<?php
}
}
new page(new newArrivals());