سؤال

I am completely new to Magento and have just now installed Magento Community Edition 1.8.1.0. I have created a few product categories from the admin console. I would like to customize the top menu based on some attributes of individual product categories. I have figured out that the changes I need to make will be in a class that overrides Mage_Catalog_Block_Navigation.

The method _renderCategoryMenuItemHtml in this class is invoked with a category. Specifically, I need Is Anchor, Description and Page Title attributes of the category in this method besides the usual ID, name and URL. I can see that the category passed to this method is an instance of Varien_Data_Tree_Node but this instance does not contain the three attributes I need.

I know that I can use the category ID available inside this method to run queries on the database to get the information I need, but I do not want to do this due to performance reasons. I am assuming that there is some code that is fetching category information from the database and is setting that information in Varien_Data_Tree_Node instances. I would like to enhance that code to include the additional attributes I need. However, I have been unable to find that code even after spending 2 days on this.

Can someone point me to the code where I can set the additional attributes in the Varien_Data_Tree_Node instance? Any alternate way of getting category attributes in the Navigation Block would also be helpful, as long as they do not affect performance.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top