Menu module shows all categories, even disabled
15 years 6 months ago #12072
by rikatos
Menu module shows all categories, even disabled was created by rikatos
Hi there and good morning !
On my test site I have a top menu item called products. This calls up a rather cool page with all my top level and sub category items. Very nice.
A link to it :
redcell.co.uk/test1/index.php?option=com...out=listing&Itemid=7
There is a slight error though. The categories under liferafts are showing all categories even the ones I have disabled at the moment.
(•MED Ship's Wheel
•Self righting
•Chutes, Slides & Recovery ) are all disabled but are still showing and can be selected.
Any ideas, I suspect this is just a coding oversight
On my test site I have a top menu item called products. This calls up a rather cool page with all my top level and sub category items. Very nice.
A link to it :
redcell.co.uk/test1/index.php?option=com...out=listing&Itemid=7
There is a slight error though. The categories under liferafts are showing all categories even the ones I have disabled at the moment.
(•MED Ship's Wheel
•Self righting
•Chutes, Slides & Recovery ) are all disabled but are still showing and can be selected.
Any ideas, I suspect this is just a coding oversight
Please Log in or Create an account to join the conversation.
15 years 6 months ago #12085
by nicolas
Replied by nicolas on topic Re: Menu module shows all categories, even disabled
Indeed. Please change the line:
$query = 'SELECT * FROM '.hikashop::table('category').' WHERE category_parent_id IN ('.implode(',',$ids).') ORDER BY category_ordering;';
by:
$childsFilters = array('category_published=1', 'category_parent_id IN ('.implode(',',$ids).')');
hikashop::addACLFilters($childsFilters,'category_access');
$query = 'SELECT * FROM '.hikashop::table('category').' WHERE '.implode(' AND ',$childsFilters).' ORDER BY category_ordering;';
in the file components/com_hikashop/views/category/view.html.php
That fix will be added to next version of HikaShop.
$query = 'SELECT * FROM '.hikashop::table('category').' WHERE category_parent_id IN ('.implode(',',$ids).') ORDER BY category_ordering;';
by:
$childsFilters = array('category_published=1', 'category_parent_id IN ('.implode(',',$ids).')');
hikashop::addACLFilters($childsFilters,'category_access');
$query = 'SELECT * FROM '.hikashop::table('category').' WHERE '.implode(' AND ',$childsFilters).' ORDER BY category_ordering;';
in the file components/com_hikashop/views/category/view.html.php
That fix will be added to next version of HikaShop.
Please Log in or Create an account to join the conversation.
15 years 6 months ago #12098
by rikatos
Replied by rikatos on topic Re: Menu module shows all categories, even disabled
Great , it works, thank you once again.
Please Log in or Create an account to join the conversation.
Time to create page: 0.234 seconds