Forums › Forums › Search & Filter Pro › Search single product category
- This topic has 9 replies, 2 voices, and was last updated 8 years, 5 months ago by
Trevor.
-
Anonymous(Private) September 15, 2016 at 8:55 am #57990
Hi,
I need to use multiple filters on my website but I have a problem. Each one should filter a specific product category in woocommerce.
I want to set up a page displaying a specific woocommerce product category (I do that with a shortcode [product_category category=”EXAMPLE”]), wich I can filter with a specific filter (I only show this filter on this page with the ‘display widgets’ plugin).
But, when I filter the page, It searches all the product categories + the url changes to a new one, so the filter widget is gone. I want to stay on the same page during filtering.
How can I solve this problem?
Kind regards
LeviTrevor(Private) September 15, 2016 at 9:43 am #57994Initially, two questions for you, if I may?
1. Which ‘Display Results method’ are you using?
2. Are the pages that you have made what WordPress calls ‘Pages’ (that is, can be edited in the Pages admin menu), or are they archives type pages, made automatically by WordPress (an example of this latter, in WooCommerce, is the ‘products’ page)?Trevor(Private) September 15, 2016 at 2:30 pm #58062OK
The WC display result method only (reliably) works on the actual shop page. Instead, you may need to use the shortcode method, which then allows you to specify the page, and you can also pre-filter the category. With my sites, I do this a lot, and have one page per category AND one filter/form per category (easy using the post duplicator).
Anonymous(Private) September 15, 2016 at 2:37 pm #58073When I use the “shortcode” display result method, the pages work fine.
I now got a page with a specific filter that stays at the right place, when I filter.But, the filter stil filters all the product_categories! Not a single categorie.
And now the results display is “not great”, I want the results to be displayed like a regular woocommerce store.What can I do to solve these last 2 things?
Trevor(Private) September 15, 2016 at 2:45 pm #58075You would have one form per page, and if in the setup you go to the Tags, Categories … tab, in the Product categories set as include, use the search, find and select the category
The appearance can also be fixed, but with you and I together on skype share screen. I have to go out now for a few hours though 🙁
Trevor(Private) November 11, 2016 at 8:58 am #69790Hi, you could use the Custom display method. It is what I use for WooCommerce pages. It allows you to use their templates. All you have to do is find where the wp_query arguments array is and add an extra argument. BUT, beware if you edit original templates, any updates overwrite these, so follow the WC guide to creating local theme versions.
This can be done two ways, either edit the array itself, as in this post:
https://support.searchandfilter.com/forums/topic/multiple-loops-on-one-page/#post-69010
Or add to the array, as in this post (I have assumed the array is called
$args
):https://support.searchandfilter.com/forums/topic/double-result-page-for-single-form/#post-68063
-
AuthorPosts