среда, 21 июля 2010 г.

Virtuemart + Joomla selected menu item

Fix for wrong selected menu item in joomla menu.
Bug reason: virtuemart finds a first menu ItemId of type "Virtuemart" and make it selected.
Almost always it is not the really selected one. And always the wrong in subcategories.

Small fix, suitable for my my task. Not perfect, but can be used as a starting point for understanding.
Find a suitable menu item for current virtuemart category or its root item.

The function url() in file /administrator/components/com_virtuemart/classes/ps_session.php
has to be changed like this:



I have added only the else branch in script above and mysql stored procedure for finding the root vitruemart category: