Limit Search to Products Only - by jmcd - on WordPress WooCommerce support

This topic has 8 replies, 2 voices, and was last updated 10 years, 1 months ago ago by Eva Kemp

  • Avatar: jmcd
    jmcd
    Participant
    September 29, 2014 at 01:29

    Can you please guide me to how to hide pages and posts from the search. We only want the search bar to search products and it keeps bring up blog posts, portfolio and private pages. I’ve included a link in the private area.

    Thank you

    Please, contact administrator
    for this information.
    7 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    September 29, 2014 at 14:44

    Hello,

    Unfortunately we don’t have such option in the theme. You may use some plugin for search form.
    Sorry for inconveniences.

    Regards,
    Eva Kemp.

    Avatar: jmcd
    jmcd
    Participant
    September 30, 2014 at 01:34

    I have tried multiple advanced search form plugins that can limit search to only products, however, none of them work with your theme (they work fine in other themes).

    Since your theme is blocking my ability to be able to implement proper search functionality, I’d appreciate it if you could assist in helping me limit the search to only products. There should be a way to do it either in the functions.php or in the search.php file.

    Avatar: Eva
    Eva Kemp
    Support staff
    September 30, 2014 at 13:23

    Hello,

    I’ve just checked the search form and it’s showing only products in the result.
    Could you please provide an example of your search query?

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: jmcd
    jmcd
    Participant
    October 1, 2014 at 01:03

    Yes, it’s inconsistent. The search results page shows only products (which is what we want).
    However, the predictive search functionality shows all categories (which is what we don’t want). Try searching for the color “green” and you’ll see what I mean.

    Avatar: Eva
    Eva Kemp
    Support staff
    October 1, 2014 at 11:27

    Hello,

    To remove all search results except of products you should edit wp-content/themes/legenda/framework/theme-functions.php file, remove the code starting from the line 1570 to 1630.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: jmcd
    jmcd
    Participant
    October 2, 2014 at 02:20

    Thank you. The only thing missing now is how to make it so the drop down of the predictive search overlays the navigation — it currently goes behind the navigation text (it’s a CSS error, but I’m not sure what exactly).

    Avatar: Eva
    Eva Kemp
    Support staff
    October 2, 2014 at 13:50

    Hello,

    Please add this code into custom.css file:

    .et-mega-search .et-search-result {
        z-index: 101 !important;
    }

    Regards,
    Eva Kemp.

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Limit Search to Products Only’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.