Filter inside current category

Forums › Forums › Search & Filter Pro › Filter inside current category

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #253537

    When we have a Search & Filter form on a category archive page, how can make sure the filtering happens only on posts belonging to the current category?

    Any way of adding a hidden field that contains the category ID and have it submitted alongside the other filters via ajax?

    Example: https://www.nzytech.com/products-services/category/cazymes/glycoside-hydrolases/acetylgalactosaminidases/

    We only want to filter on products that belong to CAZymes > Glycoside Hydrolases > Acetylgalactosaminidases

    Ross Moderator
    #253541

    You can take a look in the tags, categories and taxonomies tab of your search form – and you can include / exclude any specific term there.

    If you want to do this dynamically, based on the current page being viewed, you can use a PHP hook to change the query arguments –
    https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments

    Thanks

    Anonymous
    #253575

    We ended up by adding a product_cat field, activate “Detect defaults from current page” for “Tag, Category & Taxonomy Archives” and then hiding that field via CSS.

    Ross Moderator
    #253581

    Ah yes! That would work, easier solution 🙂

    Best

    Anonymous
    #253621

    Hi, Ross!!
    Can you post an example with the filter for the current category of the archive, please? It’s been 5 hours and still can’t achieve it 😟 . I’m using Elementor Pro. Thanks!

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