Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display Catagories in Certain Order


tnwebsite

Recommended Posts

Posted

Hello all,

 

I have a SQL question.

 

I am setting up a web store and am using a template for the site.

My Catagories show up in Alphabedical order and I need them to be in a certain order.

I know that I can make this happen by modifiying the SQL Select statement used to generate the Catagories.

 

Can someone help me with the code. This is the current code.

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' 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)) {

$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

'parent' => $categories['parent_id'],

'level' => 0,

'path' => $categories['categories_id'],

'next_id' => false);

 

Thanks a Million!

Archived

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

×
×
  • Create New...