Need to do two things..
- Post clearer instructions for anyone needing this code..
- Post a link to this post in the menu support threads since adowty never did this (as I suggested -- **sigh**). It will make it easy for others using one of these menus with hideCategories to find the required instructions..
Modification posted below is required to use hideCategories with the following menu mods:
CSS Horizontal Drop Down Menu
CSS Horizontal Dropdown Menu With jquery
CSS Flyout Menu
If you are using "CSS Horizontal Drop Down Menu" or "CSS Horizontal Dropdown Menu With jquery":
Around line 43 in includes/classes/categories_ul_generator.php find this:
Code:
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_id = cd.categories_id
and c.categories_status=1 " .
" and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
" order by c.parent_id, c.sort_order, cd.categories_name";
If you are using "CSS Flyout Menu"
Around line 47 in includes/classes/categories_ul_generator.php find this:
Code:
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_id = cd.categories_id
and c.categories_status=1 " .
// "and c.categories_id = ptc.category_id " .
// "and ptc.category_id = cd.categories_id " .
// "and ptc.product_type_id not in " . $this->document_types_list . "
" and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by c.parent_id, c.sort_order, cd.categories_name";
Regardless of which menu you use replace the code above with this:
Code:
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c LEFT JOIN "
. TABLE_HIDE_CATEGORIES . " h ON (c.categories_id = h.categories_id), "
. TABLE_CATEGORIES_DESCRIPTION . " cd
where (h.visibility_status < 2 OR h.visibility_status IS NULL)
and c.categories_id = cd.categories_id
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and c.categories_status != '0'
order by c.parent_id, c.sort_order, cd.categories_name";
This should hide your hidden categories from the menu.

Originally Posted by
adowty
...so for anyone else who needs to do this.
I found the correct syntax in the site map file.
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id
from " . TABLE_CATEGORIES . " c LEFT JOIN "
. TABLE_HIDE_CATEGORIES . " h ON (c.categories_id = h.categories_id), "
. TABLE_CATEGORIES_DESCRIPTION . " cd
where (h.visibility_status < 2 OR h.visibility_status IS NULL)
and c.categories_id = cd.categories_id
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and c.categories_status != '0'
order by c.parent_id, c.sort_order, cd.categories_name";
Yee-Haw

Originally Posted by
DivaVocals
You should also post this in the support threads for the mod you are modifying as this is code to modify two menu modules to work with hideCategories and as such, it will probably be more useful posted there..
Bookmarks