Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Filter inside current category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Diogo Comprido
    #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

    Diogo Comprido
    #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

    Cristian
    #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)

The topic ‘Filter inside current category’ is closed to new replies.