New Zenner
- Join Date:
- Dec 2007
- Posts:
- 12
- Plugin Contributions:
- 0
hideCategories
You do have the original file 'includes/modules/pages/advanced_search_result/header_php.php' , correct?
First I tried Ajeh's solution here: http://www.zen-cart.com/showthread.php?166062-Hide-category-from-search
However, I have >100 hidden subcategories like this and growing daily:
Top Level = Customer's Baskets (hidden)
SubCategory = A (hidden)
SubCategory = AAA Company (hidden)
SubCategory = AAA Company Project1 (hidden)
Products = Product with Company name (active)
Since each subcategory only has one parent_id, I couldn't figure out how to exclude an entire "top-level" category and have it recurse through all the subcategories and products, and i didn't want to add ...AND p.master_categories_id != '27'... every time I made a new folder.
Then I noticed that I have category images for all my visible categories, but no images for my hidden categories, so my work-around is:
Change:
$where_str = " WHERE (p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id ";
to exclude categories without an image:
$where_str = " WHERE (p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id
AND c.categories_image != 'NULL'";