Custom querystring is remove on filter

Forums › Forums › Search & Filter Pro › Custom querystring is remove on filter

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #263751

    Hallo,

    We have a piece of code that checks for a custom query string added in the url from another page.

    Our code that works:

    
    function filter_shop_tags($query_args, $sfid) {
        if ($sfid==112 && isset($_GET['shop-tag']) && !empty($_GET['shop-tag'])) {
            $query_args['tax_query'] = array(
                array(												 
                    'taxonomy' => 'shop_tag',												 
                    'field'    => 'slug',											 
                    'terms'    => array( $_GET['shop-tag'] ),											 
                ),
            );
        }
    
        return $query_args;
    }
    add_filter('sf_edit_query_args', 'filter_shop_tags', 20, 2);
    

    The anchor from another page is example.com/shops/?shop-tag=exampleTag.

    On the shops page we have the S&F filter. (Which is correctly filtered with the function). But when we try to active another filter with S&F. Another taxonomy for example it remove the ?shop-tag query string and turns into example.com/shops/?shop-taxonomy=exampleTax, but my wish would be: example.com/shops/?shop-tag=exampleTag&shop-taxonomy=exampleTax

    regards

    Trevor
    #263754

    I think maybe the reply Ross made on this thread might be what you are looking for:

    https://support.searchandfilter.com/forums/topic/pass-textinput-ass-url-parameter/#post-263700

    Anonymous
    #263756

    Worked like a charm! Missed this post, my apologies!

    Trevor
    #263762

    Thanks for letting me know. I will close this thread for now.

Viewing 4 posts – 1 through 4 (of 4 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.