If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Don't show documents in search results

Don't show documents in search results

Locked

Started by mattc on 4 Feb 2007, 10:40 AM · Views: 1,250

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Feb 2007, 10:40 AM
#1
mattc avatar

mattc

New Zenner

Join Date:
Jan 2005
Location:
UK
Posts:
24
Plugin Contributions:
0

Don't show documents in search results

Hi there,

I would like to remove documents from the search results so that only products show in the results.

Has anyone attempted this?

I think I would have to make changes to:
includes/modules/pages/advanced_search_results/header_php.php

but I can't figure it out. Any help would me much appreciated.

Thanks,
Matt

4 Feb 2007, 2:42 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Don't show documents in search results

We do not have any switches built in at this time to remove various Product Types from the search ...

You could customize the search select statements to exclude that product type ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Feb 2007, 12:52 AM
#3
mattc avatar

mattc

New Zenner

Join Date:
Jan 2005
Location:
UK
Posts:
24
Plugin Contributions:
0

Re: Don't show documents in search results

Thanks for the reply Linda.

Am I looking in the right file?
includes/modules/pages/advanced_search_results/header_php.php

Any other clues?

5 Feb 2007, 4:04 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Don't show documents in search results

Yes for the search you need to customize the WHERE statement to exclude a product type ...

Be careful in how that is written it can be confusing at first ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Feb 2007, 4:42 AM
#5
mattc avatar

mattc

New Zenner

Join Date:
Jan 2005
Location:
UK
Posts:
24
Plugin Contributions:
0

Re: Don't show documents in search results

I've got it working. Thanks Linda. :smile:

I changed this code:

$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:

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

This now excludes documents from the search results.
My store does not have product subcategories.
You might have to add extra code if yours does.