1.5.7c
Bootstrap clone
How would I expand the code below to display also the subcategories in the corresponding top category div?
Possibly with their own div.
Thank you
PHP Code:
<div class="row row-cols-3">
<?php
$categories_tab = $db->Execute(
"SELECT c.categories_id, cd.categories_name
FROM " . TABLE_CATEGORIES . " c
INNER JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
ON cd.categories_id = c.categories_id
AND cd.language_id = " . (int)$_SESSION['languages_id'] . "
WHERE c.categories_status = 1
AND c.parent_id = 0
ORDER BY c.sort_order, cd.categories_name"
);
foreach ($categories_tab as $category_tab) {
$cat_tab_link = zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_tab['categories_id']);
$cat_tab_name = htmlspecialchars($category_tab['categories_name'], ENT_COMPAT, CHARSET, true);
if (isset($cPath) && ((int)$cPath == $category_tab['categories_id'])) {
$cat_tab_name = '<span class="category-subs-selected">' . $cat_tab_name . '</span>';
}
?>
<div class="col"><a class="" href="<?php echo $cat_tab_link; ?>"><?php echo $cat_tab_name; ?></a></div>
<?php
}
?>
</div>
Bookmarks