Zen Cart Logo
Forums / General Questions / How to make category not show on search?

How to make category not show on search?

Locked

Views: 991

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
14 Aug 2010, 4:23 PM
#1
punkristo avatar

punkristo

New Zenner

Join Date:
Feb 2008
Posts:
40
Plugin Contributions:
0

How to make category not show on search?

On my website I have a Sold Items category qhere I put the items aftey they were sold. Everytime somebody search for something the products from the Sold Items category show up also but I dont want them to show up. How would I do it?

14 Aug 2010, 4:43 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: How to make category not show on search?

I dont know if there is a direct way to do it but you can modify the search related file to not include the products in the search results which are sold

14 Aug 2010, 4:48 PM
#3
punkristo avatar

punkristo

New Zenner

Join Date:
Feb 2008
Posts:
40
Plugin Contributions:
0

Re: How to make category not show on search?

How can I do that?

14 Aug 2010, 5:38 PM
#4
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: How to make category not show on search?

Replace this line

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

with this

$where_str = " WHERE (p.products_status = 1
			   AND p.products_quantity > 0
               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 ";

Please take the backup before you make this change

14 Aug 2010, 9:25 PM
#5
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: How to make category not show on search?

includes/modules/pages/advanced_search_result/advanced_search_result/header_php.php

14 Aug 2010, 9:27 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,703
Plugin Contributions:
56

Re: How to make category not show on search?

Wait a minute .... instead of just moving the items to the sold category, why not just mark them sold out? (or both?)
That way you wouldn't need to modify any code.

14 Aug 2010, 9:54 PM
#7
punkristo avatar

punkristo

New Zenner

Join Date:
Feb 2008
Posts:
40
Plugin Contributions:
0

Re: How to make category not show on search?

Thanks superprg, that worked. swguy if I do that it will still have the sold out items in the category with the items for sale. I want to have all the sold ones separate.

15 Aug 2010, 11:31 AM
#8
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: How to make category not show on search?

Punkristo:

Thanks superprg, that worked. swguy if I do that it will still have the sold out items in the category with the items for sale. I want to have all the sold ones separate.

Why not have the soldout category disabled that way no one will find them?

or am I missing something here???