Get Count of Filters

Forums › Forums › Search & Filter Pro › Get Count of Filters

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

    How can I count the number of filters being output programmatically?

    I’ve tried the following and can see the data, but can’t access the private attributes.

    $sf_current_query = $searchandfilter->get($sf_id)->current_query(); var_dump($sf_current_query);
    
    Trevor
    #178123

    Please note that, as your license has expired, you will first need to renew at the (discounted) renewal price to receive support.

    Does this code show anything different?

    $sf_current_query_array = $searchandfilter->get(1446)->current_query()->get_array();
    echo '<pre>';
    print_r($sf_current_query_array);
    echo '</pre>';

    You will need to change the ID number of course. There are some threads on the forum that you can search for where other users have used this code to access the filters data.

    Anonymous
    #178467

    Thanks Trevor, I appreciate your response even though the license has expired. Currently working with a recently licensed version 2.1 – but the license isn’t linked to this account.

    I was able to get this working using js from an ajax plugin I’m building (I needed a load-more button).

    Thanks again for your help!

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.