When clicking on a category in the filter to automatically execute the filter

Hi,

I want to add a functionality when clicking on a category in the filter to automatically execute the filter because i need to show the attributes assigned to that category.

Currently the filter is not intuitive because the user doesn’t know that there are attributes for the category he wants to filter and he has to select the category and click the filter for them to show.

Even worse is on mobile because he has to click on the show filter button again.

Can you please tell me in which .php file(s) is the function so i can implement the automatic filtering after selecting a category.

Hi,

Yes, we plan to improve this by adding AJAX-based filtering, currently clicking the Filter button is needed to refresh the filters form. You can try to refresh it using JS (e.g. via AJAX, by adding a new REST API endpoint), and trigger refreshing when any of the radio buttons in the Category filter is clicked. Pure PHP solution will not work in this case because just changing the category selection doesn’t trigger any back-end hooks.

Hope this helps