Forums › Forums › Search & Filter Pro › Dropdown search for taxonomy showing empty terms
Tagged: dropdown, taxonomy, Taxonomy search
- This topic has 7 replies, 2 voices, and was last updated 4 years, 9 months ago by Trevor.
-
Anonymous(Private) January 30, 2020 at 9:46 pm #232662
Hi –
I have the settings for my drop-down search set up to Hide Empty Terms. However, when I open the dropdown there are terms that are returning no results. I have updated the plugin to the latest version (2.5.0) and I even went in and updated the search and rebuilt the cache, but it is still returning empty terms in the dropdown. You can see an example here when you select (at the bottom of the page) Publishing & Broadcasting from the dropdown: https://sprouthouseagency.com/results
Let me know if I need to create you a back end login as well to look at the settings. I appreciate any help you can provide on this matter.
Thanks!
Anonymous(Private) February 3, 2020 at 2:36 pm #232916Hi Trevor — Thank you. When I turned this on, it did work. It removed the options that did not have results. However, it also removed the Combobox Script for select2 upon doing the first selection from the drop-down. I have turned it back off on the live site because I do not want the styles to be gone for the live site. However, it is definitely removing that upon searching the first time which makes it look pretty terrible. Do you have a solution for this? Thank you!
Trevor(Private) February 3, 2020 at 4:46 pm #232956If that doesn’t happen if you turn Ajax OFF, AND if you apply those styles using JavaScript (jQuery), then you need to apply them after our Ajax triggers, which can happen after 2 events;
sf:ajaxformfinish -> after Auto Count runs to update numbers
sf:ajaxfinish -> after the form submitsSample snippet:
<script type="text/javascript"> $(function(){ $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax finish"); // your code }); }(jQuery)); $(function(){ $(document).on("sf:ajaxformfinish", ".searchandfilter", function(){ console.log("ajax complete"); // your code }); }(jQuery)); </script>
Anonymous(Private) February 3, 2020 at 6:13 pm #232973Hi Trevor — Thank you for your help, I think at this time it is becoming a bit more work than we would like to do to get this back running properly. Such a bummer that the plugin doesn’t work the way it seems like it should based on the settings. I have just set up a jQuery function after the ajax runs for if it returns no results to put a message on the screen. Thanks for your help though!
-
AuthorPosts