visibility of reset button

Forums › Forums › Search & Filter Pro › visibility of reset button

Tagged: 

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #105019

    Hi, I can’t find anything in the search.

    Is it possible to have the reset button show only after submitting something? So if the Filter is not in use there is no reset button?

    I tried to look for a css class in the wrapper like .searchandfilter-on (and if not in use .searchandfilter-off) so I could target the button via the wrapper class.

    Trevor
    #105034

    Hi

    You could use PHP to see if the results are filtered, like this (change the ID number for yours):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1234)->current_query();
    if (($sf_current_query->is_filtered())||($sf_current_query->get_search_term()!="")) {
      // do something that identifies a search has been made (set some CSS, ...)
    }
    // your normal template code here
    
Viewing 2 posts – 1 through 2 (of 2 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.