Forums Forums Search & Filter Pro Ignore certain filter from query

  • This topic has 12 replies, 2 voices, and was last updated 8 years ago by Anonymous.
Viewing 10 posts - 1 through 10 (of 13 total)
  • Anonymous
    #73062

    I want to use some filter as just a GUI element to execute javascript function.
    So I’d like to exclude these filter from query.
    How do I do that?

    Trevor
    #73105
    Anonymous
    #73392

    I don’t see the filter value in first parameter of sf_edit_query_args.
    Where do I modify it?

    Trevor
    #73577

    I am not sure what you are asking? You can ‘see’ what is in $query_args by outputting the array to the page, like this (in PHP):

    echo "<pre>";
       print_r($query_args);
    echo "</pre>";
    Anonymous
    #73597

    Yes I checked with print_r($query_args) and there is no query of the filter.
    Actually it’s empty.

    How do I unset the query of filter? Where is it?

    Trevor
    #73605

    What you need to do is deliberately put values in each field so the query has a value to see and submit it, or is this what you did?

    Anonymous
    #73627

    “put values in each field” means Search&Filter form on frontend?
    I thought when form data was submitted, I can catch values in sf_edit_query_args.
    But actually I don’t see any values related to filters.

    i.e. this is a sample of $query_args in sf_edit_query_args
    At that time I correct this data, couple of filters had values.(selected)
    But there isn’t any in $query_args.
    Array
    (
    [paged] => 1
    [search_filter_id] => 194
    [search_filter_override] =>
    [posts_per_page] => 10
    [post_status] => Array
    (
    [0] => publish
    )

    [meta_query] => Array
    (
    )

    [post_type] => product_resource
    )

    Trevor
    #73631

    mmm

    I think I need a fresh pair of eyes on this. I will ask Ross to take a look.

    Trevor
    #73806

    So, I have spoken to Ross. He says what you want to do is not really possible. He did explain it to me, but essentially the chances are that the filter is already in our caching system (taxonomy or meta filter) and that means you can’t see it in the args to remove it as S&F has already processed this and added the relevant post IDs to the post__in argument.

    You could use another field, like the post type field. You could then use sf edit query args to overwrite the post type argument manually effectively ignoring the user selection on the post type field …..

    then…

    You can use the filter we have to edit the field options to put whatever options you want.

    A round-a-bout back-door way of doing what you want.

    Anonymous
    #73867

    I understand.
    Thank you for giving me a wordaround anyway.

    I think It’s better to use javascript to add form element dynamically.
    Also I’m looking forward to html block function you mentioned on another topic.

Viewing 10 posts - 1 through 10 (of 13 total)