This is a discussion on tep_get_category within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; how do I get all categories with parent _id not equal to 45 the function is thus: function tep_get_categories($categories_array = ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| how do I get all categories with parent _id not equal to 45 the function is thus: function tep_get_categories($categories_array = '', $parent_id = '0 ', $indent = '') { global $languages_id; if (!is_array($categories_array)) $categories_array = array(); $categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { $categories_array[] = array('id' => $categories['categories_id'], 'text' => $indent . $categories['categories_name']); if ($categories['categories_id'] != $parent_id) { $categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  '); } } return $categories_array; |
| Sponsored Links | ||
| ||