Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Categories on Top


howgo

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...