howgo Posted April 17, 2003 Share Posted April 17, 2003 Hello, I would like to sort the new categories with a higher ID on the Top of the categorie overview - thats more easily for me users. User don?t have to scroll around to see the new one. Does somebody have a idee, how i can code it ? In which file are the parts I have to change ? I searched for the place in code, but I only found sql statements. Do I have to change the sql statements ? I don?t want to set the first categories with a high ID in sort order of admin, because its only a workaround and not satisfying. Thank you for each idea Bye Andreas Link to comment Share on other sites More sharing options...
Ajeh Posted April 17, 2003 Share Posted April 17, 2003 You can re-write the code to sort based on categories_id rather than sort_order Link to comment Share on other sites More sharing options...
howgo Posted April 17, 2003 Author Share Posted April 17, 2003 Hello, i got it, very nice :D So, what i did. I opened index.php, searched for $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name"); i changed this to $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order [b]DESC[/b], cd.categories_name"); Very simple or not ? :wink: Bye Andreas Link to comment Share on other sites More sharing options...
howgo Posted April 17, 2003 Author Share Posted April 17, 2003 Sorry, i wanted to mark the changed thing, but in code tag you aren?t able to do this, my fault. The correct thing, you should replace yours with $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order DESC, cd.categories_name"); Dear Webmaster, why I can?t change my own posting ? Bye Link to comment Share on other sites More sharing options...
Ajeh Posted April 18, 2003 Share Posted April 18, 2003 Because it would mess up the threads for folks who get the emails if everyone had the edit feature available. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.