Do not show subcategories when user submits a search

I am having the same problem that was reported by user @Hay on Aug. 2023:

Let’s try to wrap it up:

  • If we want users to be able to navigate explore categories and subcategories, it is mandatory to enable the option Display subcategories instead of listings in the categories that have subcategories.
  • In such a category, if a user enters a search keyword and hits the search button, the resulting page still shows the subcategories instead of the results. The user then needs to click on a subcategory to show the search results for that subcategory only. This doesn’t make sense on a UX point of view and is counter-intuitive. As user @Hay pointed out, it leaves the impression that the query yielded no results at all, an impression that is further reinforced by the fact that each category still displays the global count of the category, not the actual number of search results for that category. Furthermore, this prevents the user from being able to filter the results for the entire category using the filters section.
  • The OP was suggested to use the HivePress category block on dedicated pages to display the subcategories, and to leave the Display subcategories instead of listings unchecked to allow displaying the search results instead of the category’s subcategories.
  • This would definitely work. But what would NOT work anymore, is the ability to navigate through categories and subcategories using the HivePress blocks, as clicking on a category displayed by such block will direct the user to the listings of that category, NOT the custom page that displays its subcategories!

The feature requested
To achieve the best of both worlds, the most logical behaviour for HivePress would be to observe the Display subcategories instead of listings option only when there is no search query submitted by the user; otherwise the search results would gracefully be displayed – along with the applicable filter options – in place of the subcategories.

In the meantime – furthermore if the hereby requested feature is rejected --, I’m willing to find a tweak myself and share the solution here, but any hint on how this could be achieved would be greatly appreciated!

Thanks for this great plugin and the effort that is put in supporting it.

Hi,

Thanks for your suggestion. Please note that this feature exists to force the user to select categories in any case, so that the correct filters are displayed (if you have an attribute bound to a category). Since there are sites where, for example, there are apartment reservations and product sales, and it would not make sense to display product names in one filter and rental prices.

1 Like

Thanks, I understand this use case (which I didn’t have in mind) and the importance of displaying the appropriate filters along the results…

In such case wouldn’t it make more sense (on a UX standpoint) to display the number of matching search results (eg. “5 results”) instead of the total the number of listings (eg. “20 listings”) for each category, and eventually to mask the empty categories (that yield no match) when displaying the search results?

Hi,

Thank you for your feedback, we plan to add this feature in the future updates.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.