lat9, Thank you very much!
Now I can get all subcategories IDs and path by the following code:
$sub_current_ids=array();
zen_get_subcategories(&$sub_current_ids, $current_category_id);
$count = count($sub_current_ids);
For ($i=0; $i < $count; $i++)
{
$x = 'cPath=' . $current_category_id . '_' . $sub_current_ids[$i];
echo zen_href_link('index', $x) . '<br>';
}
And the query is in the numberic sort order by IDs:
array[0] http://localhost/loafer/index.php?main_page=index&cPath=23_1
array[1] http://localhost/loafer/index.php?main_page=index&cPath=23_2
array[2] http://localhost/loafer/index.php?main_page=index&cPath=23_3
array[3] http://localhost/loafer/index.php?main_page=index&cPath=23_25
array[4] http://localhost/loafer/index.php?main_page=index&cPath=23_27
How can I make the query in the "correct" sort order? Just like the sort order of category sidebox or site map?
I have been studied in functions_categories.php but don't know what to do next...
$categories_query = "select c.categories_id, cd.categories_name, c.categories_status
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where " . $zc_status . "
parent_id = '" . (int)$parent_id . "'
and c.categories_id = cd.categories_id
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
Can anyone help?
Thanks!