Forums › Forums › Search & Filter Pro › Have external list of selected filters which can then be removed possible?
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by
Trevor.
-
Trevor(Private) July 5, 2019 at 2:23 pm #215627
Some of what you ask for MIGHT be possible with a lot of custom coding (which would not be within the scope of our support), as you can access the filters array, but to add the ability to remove filters, and to show their counts, this is not possible.
It is something were are working on for V3.
Anonymous(Private) July 5, 2019 at 3:48 pm #215642Hey @Trevor thanks for your message. What would be the hooks that I need to look in to getting this off the ground?
Also there is no way to show how many results there are? Lets say I have 10 posts and I do not filter anything, there would be 10 results in total. But if I than search for post with the name “banana” there would only be 2 results, because there are only 2 posts related to banana. I would figure that this number would be fairly easy to get.
Trevor(Private) July 5, 2019 at 4:04 pm #215649To fetch the search terms, the https://searchandfilter.com/documentation/accessing-search-data/ guide is basic but you can extend the idea to grab lots of other data. If you have other filters, then it becomes a little more complex, but I can give you links. This thread might help you:
https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
… and this search will give similar threads I think:
https://support.searchandfilter.com/forums/search/sf_current_query+get_array
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
You could use this to display the filter array:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1391)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>Where the ID needs to match that of your form.
Trevor(Private) March 23, 2021 at 2:06 pm #275883We are testing the free core plugin now and finishing off the pro addon plugin. The other major component (which required a lot of coding) we finished a little while ago. It was to bring the capability to control the results layout, content and appearance, something we have left to themes and page builder plugins until now.
It was also intended to make it built in to the search plugin itself, but we instead decided to release it as a free standalone plugin:
https://wordpress.org/plugins/custom-layouts/
So, three plugins in all. One is released, one is in internal testing (soon to go to beta) and the third we are finishing off. Right now we are hoping within a few months.
-
AuthorPosts