Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sub-categories


Alexian

Recommended Posts

Is there a contribution for the Sub-categories ?

 

I want to have something like this:

 

www.play.com

 

I've created a menu. I've linked the menu above to the catogorie's. But i want to have catogorie-box wich only let you see the Sub-categories of the catagorie wich you are looking.

 

I hope you understand what'i'm trying to tell. I've also found this:

 

Contribution number: 885

Name: Show Sub-categories

 

click Here

 

I've installed this module. But it also shows other catagorie's and the sub-catagorie's.

Link to comment
Share on other sites

if you need to do it for the categories box only, then in the catalog\includes\boxes\categories.php there is the query to pick a list of categories for processing:

 

  $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");

 

If you notice the filter is the c.parent_id

 

Now in includes\application_top.php the current category is store in the $current_category_id variable. By modifying the above query

 

  $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 = '" . (int)$current_category_id ."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

 

should do what you want

 

If you need to do that like that side (inside the page) you could copy something like the new_products related files and modify them for categories.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...