I’m creating a module that let’s you define some extra options for categorys in Magento, following this tuturial to get started: http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/installing_custom_attributes_with_your_module
I built on a skeleton module created with ModuleCreator.
I have created Setup.php (with the capital) in Infoweb/Margins/Model/Resource/Eav/Mysql4/
and in it my class defined:
class Infoweb_Margins_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup{}
I also added this line in my config.php(the rest was already there because of the skeleton module):
<class>Infoweb_Margins_Resource_Eav_Mysql4_Setup</class>
Now when trying to load a page, magento searches for this class but gives a fatal error saying the class was not found …
Error:
Fatal error: Class ‘Infoweb_Margins_Resource_Eav_Mysql4_Setup’ not found in /home/users/A000456/xxx/xxx/app/code/core/Mage/Core/Model/Resource/Setup.php on line 160
Thoughts on where the problem lies?
Using Magento 1.4.1.0
Magento is complaining that it can’t find your class
this is actually semi-good news. The fact that Magento knew to look for a class with the prefix Infoweb_Margins means you have your XML setup correctly.
The problem is your class name. Magento’s auto loader only* knows how to handle class in the form
your class is named
which Magento doesn’t know what to do with.
If you’ve placed a file named Setup.php at
you want a class named
Change that in your XML and class definition and you should be set
* this might be a semi-fib, I haven’t peeked at Magento’s __autoloader in a while