Include/exclude taxonomy not working

Forums › Forums › Search & Filter Pro › Include/exclude taxonomy not working

Viewing 8 posts – 1 through 8 (of 8 total)
  • Anonymous
    #219395

    Hi,
    I have a form that searches using three custom taxonomies (age group, city, and category). There are four age groups and I want to create a one form for each, that will only return results that have been assigned that age group. I can’t use the exclude option because many items are assigned more than one age group. However, using the “include” option under the “Tags, Categories, & Taxonomies” to specify the age group I want to target with the form doesn’t seem to do anything. For the form that “includes” the Seniors age group, I’m still getting results that haven’t been assigned the Seniors taxonomy term. How can I achieve the result I need?
    Many thanks for your time,
    Carina

    Trevor
    #219412

    You can only use one form per page. Maybe that is the issue you face?

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #219470
    This reply has been marked as private.
    Trevor
    #219531
    This reply has been marked as private.
    Anonymous
    #219573
    This reply has been marked as private.
    Trevor
    #219589
    This reply has been marked as private.
    Anonymous
    #219593

    Thanks Trevor, always a pleasure 🙂
    For folks with a similar issue, what I learned is that the “include” function specifies which taxonomy terms will be added to a select list, but it does NOT pre-select any term, so the default is still “all categories.” Trevor provided a jQuery snippet which I was able to modify, which sets the select option of the age field to the value I want on that page. My version is roughly:

    <script>
    jQuery( document ).ready(function(){
     var age = 'senior';
      jQuery('select[name="_sft_ages[]"').val(age);
    });
    </script>

    And I just modify the age variable depending on which age group’s page flow I’m on. So far it’s returning the results I want, and I can see the correct age group passed in the URL.
    Thanks again Trevor!
    –Carina

    Trevor
    #219601

    Thanks for letting us know Carina. I will close this thread for now.

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