Forums Forums Search & Filter Pro Hierarchical Filtering Based on Two Different Taxonomies

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #234712

    Hi, I have a particular use case for a tourism website where there is a relationship between two different taxonomies. I’m aware that this can be achieved through hierarchical taxonomies but I would like to have two separate lists for filtering.

    For example, suppose we have a custom post type called Tours and two custom taxonomies associated with this post type called Continents and Countries. The issue arises when a particular tour travels to multiple continents. If we have a tour that goes to both Morocco in Africa and Spain in Europe, the Continents taxonomy would have Africa and Europe, while the Countries taxonomy would have Morocco and Spain. Now, if I create two taxonomy filters for both Continents and Countries in my search & filter form, if a user clicks Europe within the Continents taxonomy filter, both Morocco and Spain would show up in the Countries taxonomy filter. Similarly, if a user clicks Morocco in the Countries taxonomy filter both Europe and Africa would show up in the Continents taxonomy filter.

    I’m aware that this is the intended behavior but is there a way for me to specify a relationship (i.e. if I had a list of all countries within a continent) such that when a user selects Morocco in the Countries taxonomy filter only Africa will show up in the Continents taxonomy filter and vice versa.

    Your help is very much appreciated. Thanks.

    Trevor
    #234719

    The relationship will be assumed by our plugin if it finds terms in the posts. This will be shown in the form ONLY if, in the General settings tab of the form:

    Set Auto Count (both settings) to ON

    And then in the Form UI:

    In each field set Hide Empty to ON

    Anonymous
    #234725

    Hi Trevor. Thanks for your reply.

    This is what I have set already.

    What I’m trying to achieve is slightly different from the intended behavior as I want Europe that is specified in the Continents Taxonomy to not show up when the Morocco Country taxonomy is selected even though both these terms are specified within the same post.

    Trevor
    #234733

    But Morocco is not in Europe? It is in Africa. If it is showing up, than a post must have it set as in Europe.

    Anonymous
    #234736

    To clarify, there is a tour that visits both Morocco in Africa and Spain in Europe. So there is a post with the Continents Taxonomy set as Africa and Europe as well as Country Taxonomy set as Morocco and Spain. I was wondering if there is a way to use some sort of list to modify this behaviour so that Europe doesn’t show up when Morocco is selected and Morocco doesn’t show up when Europe is selected.

    Trevor
    #234745

    I cannot think of a way to do that, sorry.

Viewing 6 posts - 1 through 6 (of 6 total)