[Resolved] Custom search/filter only certain product categories?
This thread is resolved. Here is a description of the problem and solution.
Problem:
how to exclude specific taxonomy term from search result
Solution:
If you do not added category search filter, you will just require to add the taxonomy filter and select the option "NOT one of the following" and select the category you want to exclude from search.
I'm trying to create a custom woocommerce product search that only searches within certain categories.
Is there any documentation that you are following?
hidden link
I can easily create a search form with views to create a custom search to search all products, but I'm wondering how to go about excluding or only listing results in certain catagories. such as: right now say I have 4 categories...... one, two, three and four. I only want to show results if they are in category one and two. possible? if so how......
Basically, I have the search form on page 1, so no initial view results are displayed, it only displays the form on that page. Users search for items in the store and are directed to the results page.
I am just looking for how to exclude results from certain categories in the results. So for example, if I have 3 categories.....one, two and three, I only want items from categories one and two to show up on the results page.
So in category
one -- (shirt, shirt 1, shirt 2)
two -- (shirt 4, shirt 5, shirt 6)
three -- (shirt 7, shirt 8, shirt 9)
If I am only including results from categories one and two in the results, if the user searches for "shirt" the only results that would show up on the results page would be (shirt,shirt 1, shirt 2, shirt 4,shirt 5, shirt 6)
(shirt 7, shirt 8, shirt 9) would not show up on the list of results.
hope that explanation makes more sense++ 🙂 thanks much++
As I understand - you have added the text search to your search form - correct? if yes, do you have only text search with your search form or you have added category search filter as well.
When I choose " Display the results using a custom search" when creating the view, on the resulting view edit page "Query filter" is not an option to set.
Can you please click on "Screen Options" button available at top right corner of your edit view page and activate the "Query Filter" checkbox, then you will be able to see the "Query Filter" section on your edit view page.