- Posts: 65
- Thank you received: 0
Filters and access levels
14 years 9 months ago #32269
by soheilom
Filters and access levels was created by soheilom
Hello
I have a filter of a custom field called "color" and I want it to show up only for registered users (in my case I created a user group called profesionals). But when I set the access level in the filter settings it doesnt work. It keeps on showing up for all users, even if I set access level to none it shows up. Why is this happenning? how does the access level in filters work? how can i make it show up only for registered users?
I have a filter of a custom field called "color" and I want it to show up only for registered users (in my case I created a user group called profesionals). But when I set the access level in the filter settings it doesnt work. It keeps on showing up for all users, even if I set access level to none it shows up. Why is this happenning? how does the access level in filters work? how can i make it show up only for registered users?
Please Log in or Create an account to join the conversation.
14 years 9 months ago #32293
by nicolas
Replied by nicolas on topic Re: Filters and access levels
Hi,
Indeed, there is some code missing.
Please change the line:
$query='SELECT * FROM '.hikashop_table('filter').' WHERE filter_published = 1 ORDER BY filter_ordering';
by:
$conditions = array('filter_published = 1');
hikashop_addACLFilters($conditions,'filter_access');
$query='SELECT * FROM '.hikashop_table('filter').' WHERE '.implode(' AND ',$conditions).' ORDER BY filter_ordering';
in the file administrator/components/com_hikashop/classes/filter.php and that should make it work.
Indeed, there is some code missing.
Please change the line:
$query='SELECT * FROM '.hikashop_table('filter').' WHERE filter_published = 1 ORDER BY filter_ordering';
by:
$conditions = array('filter_published = 1');
hikashop_addACLFilters($conditions,'filter_access');
$query='SELECT * FROM '.hikashop_table('filter').' WHERE '.implode(' AND ',$conditions).' ORDER BY filter_ordering';
in the file administrator/components/com_hikashop/classes/filter.php and that should make it work.
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds