Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Hide category from search

    Hi,
    does anyone know of a way to exclude a certain category from the search?
    We have a category, which is active in menu, but that we dont want to show it in the search.
    So no products within this certain category shall show up in the search in other words.

    I have struggled with this for several hours now but cant figure it out.

    /Jagge

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide category from search

    You can customize the file:
    /includes/modules/pages/advanced_search_results/header_php.php

    and change the WHERE statement:
    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 exclude the category such as:
    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 
                   AND c.categories_id != '27'";
    where 27 is the category to exclude ...

    NOTE: you could also use in its place:
    AND p.master_categories_id != '27'

    depending on which works best for you ...
    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: v1.5.5]
    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!

  3. #3
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Re: Hide category from search

    Thx Ajeh!
    Worked perfectly!

    /Jagge

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide category from search

    Thanks for the update that this worked to exclude your specified Category from the search ...
    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: v1.5.5]
    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. #5
    Join Date
    Jun 2007
    Location
    Eustis, Florida, USA, EARTH
    Posts
    836
    Plugin Contributions
    0

    Default Re: Hide category from search

    Ok that works for removing categories from search but can you hide the search box in certain categories?

  6. #6
    Join Date
    Oct 2007
    Location
    On the edge of Bodmin Moor, Cornwall, UK
    Posts
    3
    Plugin Contributions
    0

    Default Re: Specify a Category to Search

    Hi Ajeh,

    We have a similar requirement.

    On our website www.inlinefilters.co.uk I intend to put all our part number cross references in the category Brands/PartNumbers, 300000 of them.

    We have two search boxes that are written in HTML in define_main_page.php. The Part Number search box uses this basic code to call up Advanced Search:

    onfocus="if (this.value=='Enter any Filter Part Number here to find our Equivalent') this.value='';" onblur="if (this.value=='') this.value='Enter any Filter Part Number here to find our Equivalent';"//>
    <input type="submit" name="submit" class="submit" value="Search" />
    <input type="hidden" name="main_page" value="advanced_search_result" />
    <input type="hidden" name="search_in_description" value="1" />

    I need it configure it to just search the category Brands/PartNumbers where our cross reference data will be.

    We also have two of Zen Cart's standard search boxes on the top line. Our web hosts have managed to clone the Advanced Search and hard coded it into the Part Number Finder search box to enable the required search from there (possibly not uploaded yet).

    Now we require the same thing from our HTML define_main_page.php search but they are saying it is impossible to call their clone from there.

    Is there a simple way to add criteria to our define_main_page.php or is a lot more programming required in or with includes/modules/pages/advanced_search_results/header_php.php where I believe all the search programming is?


    Best regards,

    Neville

 

 

Similar Threads

  1. Replies: 16
    Last Post: 2 May 2014, 10:07 PM
  2. v151 Hide one category from category side box
    By robbie269 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Feb 2014, 03:35 PM
  3. Remove / Hide category link from category image on home page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 15 Mar 2010, 11:50 PM
  4. trying to hide product from search
    By nresponse in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 11 Oct 2006, 03:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR