Filter default values

Forums › Forums › Search & Filter Pro › Filter default values

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #126682

    Hi,

    I have 3 filter dropdowns (categories, tags and a custom taxonomy).
    It’s working fine, but I wonder if it’s possible to select values of those three dropdowns based on a session I made?
    Each user has it’s own preferences in it’s profile, based on that, they should have the search result filtered when they visit the page. However, they should be able to change the filters afterwards.

    Anyone has a clue how to do it?

    Thanks!

    Trevor
    #126691

    You might be able to do it with custom coding using our Edit Query Arguments filter. But I would not know how. There are examples users have posted in this forum that they have written.

    Anonymous
    #126699

    Thanks for the link.

    I fixed it the following way:

    function filter_function_name($input_object, $sfid) {
      if($input_object['name']=='xxx') {
        $input_object['defaults'] = array("yyy");
      }
      return $input_object;
    }
    add_filter('sf_input_object_pre', 'filter_function_name', 10, 2);
Viewing 3 posts – 1 through 3 (of 3 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.