Search code examples
magentoattributescategoriesmegamenu

Source model "megamenu/menutype" not found for attribute "menutype" on Magento 1.9


Our site is based on Magento 1.

We installed Mega menu extension which purchased from magestore team.

But, when we click the catalog/Manage categories on backend admin setting, we got this error.

How to solve this issue?

 **There has been an error processing your request**

 Source model "megamenu/menutype" not found for attribute "menutype"

 /app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(386): Mage::exception('Mage_Eav', 'Source model "m...')
 /app/code/core/Mage/Adminhtml/Block/Widget/Form.php(201): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php(113): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset))
 ...

screenshot of error page


Solution

  • This issue was solved successfully. Menutype was conflicted by old one. We had used Peerforest_Megamenu extension on our site. Although we disabled the old mega menu extension, but this attribute was remained on our database. So, when we installed new extension whose name is Magestore mega menu extension, that issue was occurred.

    Furthermore. Peerforest_Megamenu had created some new attribute like megamenu/menutype on category table and these attribute required a model source to display the options.

    When we disabled Peerforest_Megamenu, they couldn't find the their model source anymore. I just created some new model source files for those attributes. This is new menu type code block.

    <?php
      class Magestore_Megamenu_Model_Menutype extends 
          Mage_Eav_Model_Entity_Attribute_Source_Abstract
          {
              protected $_options = array();
    
           public function getAllOptions()
           {      
              $this->_options[] = array('value' => 'megamenu-horizontal','label' => 'Mega Menu');
              $this->_options[] = array('value' => 'megamenu-vertical','label' => 'Vertical');
    
              return $this->_options;
           }
    
       }
    

    Hope my answer will help others. Thank you for your consideration. Regards.