Hide Categories in Filter Dropdown

  • Steve Brown
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 10 months ago - 2 years 10 months ago #144326 by Steve Brown
Hide Categories in Filter Dropdown was created by Steve Brown
  Hello Tuan,
Really enjoying the product.
I have a question/request.  When using the Front End Plan Manager, is it possible to hide the categories the logged in user has no access to per the "access level" set in the category?
All of my plans are listed in the dropdown.  If the user clicks on a category and does not have access to that category, the filter refreshes and is blank, which is great.  But, could you not have the category in the filter in the first place?
I have reviewed the code and found references to authorized view level, but cannot locate the query that builds that filter dropdown in the toolbar.

Thank you in advance....
 
Last edit: 2 years 10 months ago by Steve Brown. Reason: added pic for clarity

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #144328 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Hide Categories in Filter Dropdown
Hello Steve

The method is buildCategoryDropdown in components/com_osmembership/helper/html.php

You can modify the query inside that method to below code and it should be fine:
Code:
$query->select('id, parent_id, title') ->from('#__osmembership_categories') ->where('published=1') ->where('access IN (' . implode(',', JFactory::getUser()->getAuthorisedViewLevels()) . ')');

Please Log in or Create an account to join the conversation.