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)