-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
29 lines (26 loc) · 1.11 KB
/
functions.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
<?
function show_menu($categorys,$url=false) {
$return='<ul>';
foreach ($categorys as $category) {
if ($url) $link=$url.'_'.$category['ALIAS']; else $link=$category['ALIAS'];
$return.='<li class="category'.$category['ID'].'"><a href="#'.$link.'">';
if ($category['NAME']) $return.='<span>'.$category['NAME'].'</span>';
if ($category['IMG']) $return.='<img src="'.$category['IMG'].'" alt="'.$category['NAME'].'">';
$return.='</a></li>';
}
$return.='</ul>';
return $return;
}
function show_items($items,$number_format) {
$return='<div class="items_tovars">';
foreach ($items as $item) {
$return.='<div class="item item'.$item['ID'].'" data-id="'.$item['ID'].'">';
$return.='<div class="img"><img src="assets/images/no-image.png" data-src="'.$item['IMG'].'" alt="'.$item['NAME'].'"></div>';
if ($item['NAME']) $return.='<div class="name">'.$item['NAME'].'</div>';
if ($item['PRICE']) $return.='<div class="price">'.number_format($item['PRICE'],$number_format['decimals'],$number_format['dec_point'],$number_format['thousands_sep']).'</div>';
$return.='</div>';
}
$return.='</div>';
return $return;
}
?>