Forums › Forums › Search & Filter Pro › different filters for category pages
- This topic has 5 replies, 2 voices, and was last updated 5 years, 2 months ago by Trevor.
-
Anonymous(Private) August 30, 2019 at 5:07 pm #220077
Hi,
I would like to achieve:– need to filter products and product variations (two post types)
– would like to have different filters for category archive pages. For example: On category archive page for clothing I don’t need to show filter for “shoe size” taxonomy. I think that it is possible to make 2 filters with different attributes and show specific filter for specific category archive page. Maybe would be better to hide/show attributes depends on category pages (only one instance of filter would be needed).
– filtered products (display results) should also showed on category archive pageCould you please help me, how can I achieve that ?
Regards,
Anonymous(Private) September 1, 2019 at 8:09 pm #220112“You can only have one Woo search form”
How can I then understood one of your top feature, which you claim on your site: “Unlimited Search Forms – Create as many different search forms as you like! Why not put 2 on the same page?”You’ve written about CSS, but it will needed also some JS codes.
Is it possible to hide it on server side ? Maybe with any hooks (add_action) stuff.When I change Display Results to “Post Type Archive” I can use one post type (product / product variation) only.
Trevor(Private) September 2, 2019 at 1:49 pm #220124You raise two issues. The first about creating as many forms as you want. You can, but because the WooCommerce/Post Type Archive display methods attach to the wp_query in the archive template pages of the Post Type, only one form can attach per Post Type archive template, otherwise they would conflict. You can still add forms with other types of display methods to your site.
To the second question, it is possible to put more than one form on the same page, as long as that page is not the results page for more than one of those forms (any other form must go to another page to show its results. The reason here is that forms do not interact with each other (so, a field in one form will not see any changes in the same field in another form) as we use JavaScript to submit the form and process the filters.
As to needing JS code, it should not. Make the all-in-one form, place it on two pages, show me those pages and tell me which fields need to disappear on each page, and I will show you the CSS.
The WooCommerce method is a special case of the Post Type Archive method (and so cannot be used at the same time as a form using the post Type archive method when searching ‘products’. This WooCommerce method is special in that it allows you to select both ‘products’ and ‘variations’, as for WooCommerce there is a special WooCommerce archive template that combines both in to one page. Thus, the normal Post Type Archive method cannot select both Post Types, as indeed it cannot select more than one Post Type of any type.
-
AuthorPosts