Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Removing sub-categories displaying


raeB

Recommended Posts

I want to be able to remove the sub-categories from displaying in the categories box. So when you click on a category it WILL NOT expand and show subcategories.

 

But I still want to have the subcategories show up in the main page area when a category is clicked.

 

Thanks if you can help!

Link to comment
Share on other sites

  • 1 month later...
Hide lines 93-128 in boxex/categories.php

Should do the trick

 

 

  if (tep_not_null($cPath)) {
   $new_path = '';
   reset($cPath_array);
   while (list($key, $value) = each($cPath_array)) {
     unset($parent_id);
     unset($first_id);
     $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)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 }

Do you mean those lines? How do i 'hide' them. Do i just do a // before each line. Will this work so that the subcategory list will not be shown.

 

Thanks

Angi B)

Link to comment
Share on other sites

Do you mean those lines?  How do i 'hide' them.  Do i just do a // before each line.  Will this work so that the subcategory list will not be shown.

 

Thanks

Angi B)

 

 

Ok, that took out all the categories. I just want to take out the SUBcategories. I don't know php too well so if anyone could give me a hint on what i am looking for i will be eternally grateful.

 

Thanks

Angi

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...