Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"disable" one specific category in categories.php


a.niedermann

Recommended Posts

Hey!

 

I made one unique page for one of the products in my shop. And added a link to that page in categories.php. Now I have the problem of a double entry. Once the entry of the categories string and once the link I inserted.

 

How can I manage, that the categories.php does not display this specific category id (the categories links which it creates automatically) without deleting the category?

 

Thanks for help!!

 

Andreas

Link to comment
Share on other sites

In includes/boxes/categories.php you could alter the $categories_query by adding

and c.categories_id != 21

 

In the above example 21 is the id of the category I want to hide. Note that if you change your category structure in the future, you would have to check if 21 is still the id of the category you want to hide...

Link to comment
Share on other sites

Around line 73

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

 

 

Around line 99

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

 

Note: replace 21 by your category id

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...