I am creating Custom Shipping Method in Magento.i had refered Inchoo, Excellence blog and even other blogs but everytime i get this error

Fatal error: Call to a member function setStore() on a non-object in /app/code/core/Mage/Shipping/Model/Shipping.php on line 424

Please Help Me.


Most probably the model that should handle the shipping method is not found.
Either it does not exist, or it is wrongly configured.

Make sure you have in your config.xml the model for the shipping method.
In the example you used it's


This means that the model used will be Mage_Shipping_Model_Carrier_Inchoocustom. Make sure that exists also.

You can easily test with this code...

echo get_class(Mage::getModel('shipping/carrier_inchoocustom'));

Put that in any page of your code.

If that renders nothing it means the class Mage_Shipping_Model_Carrier_Inchoocustom is not found. Either it does not exist or it is placed in the wrong file/folder.

if it outputs Mage_Shipping_Model_Carrier_Inchoocustom it means you are missing the <model> declaration in config.xml.

And on a side note, with all respect for Inchoo and the great work they are doing in their example something is wrong. Even if it works, the Mage folder should not be used for custom extensions.

You can also check this for an other tutorial on how to create a shipping method: www.magentocommerce.com/wiki/5_-_modules_and_development/shipping/create-shipping-method-module

  • yes marius you are right the get_class is not returing anything.but my file is exists at the proper place. Jul 18 '14 at 7:28
  • Check for misspellings in the class names or folder names. Turn on the developer mode and error reporting and your error should be printed on the screen if there is one.
    – Marius
    Jul 18 '14 at 7:39

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.