in my class shipping in the file app/code/community/Innnoexts/Core/Helper/shipping.phpp.

I want to call the method getMethods() in the file app/code/local/Collinsharper/Purolator/Model/Source/Method.php I wrote this code

$test = Collinsharper::getModel(Purolator/Source/Method);
        echo '<br>'


but, I got this error PHP Fatal error: Class 'Collinsharper' not found in /www/sites/mysite.com/files/html/app/code/community/Innoexts/Core/Helper/Shipping.php

could you help me to give me the right instruction to call this method?



Magento don't use Collinsharper::getModel(Purolator/Source/Method); type . factory pattern and factory method.There are lot issue on your module.You need to basic study on magento module structure.

Issue1:Magento factory call

Ii should be Mage:: instead of Collinsharper::

start the factory method Mage::

It function is call at Mage.php(magentodir/app)

Issue2:Magento modelprefix for a module

getModel(Purolator should not be this.It should be getModel("modelprefix/

Model Prefix is define at app/code/community/Innnoexts/Core/etc/config.xml under <global> tag

        <modulePrefix><!-- guess that modulePrefix is your module model prefix -->

Magento model factory method look like:


Note: Here Innoexts_Core is this path of module.

Issue3:Factory method model class

As you have want to call function of Method.php from app/code/local/Collinsharper/Purolator/Model/Source/Method then it Method.php class should be


Then factory method is like


Collinsharper_Purolator_Model is modelPrefix as config.xml define

and source_method emulate as Source_Method.

Please check at http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/

  • thanks amit, this is what I used: $puroMethods = Mage::getModel(Collinsharper_Purolator_Model_Source_Method)->getMethods(); – devopsmagento Apr 1 '15 at 19:46
  • no you canot use this – Amit Bera Apr 1 '15 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.