Fatal error: Call to a member function getCollection() MAGENTO

Fatal error: Call to a member function getCollection() MAGENTO

September 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Fatal error: Call to a member function getCollection() MAGENTO

Understanding the ‘Call to a member function getCollection() on a non-object’ Error in Magento

Hello there,

Are you facing the Fatal error: Call to a member function getCollection() on a non-object issue in your Magento installation? Let me walk you through this common problem and provide a comprehensive solution.

Understanding the Error

This error occurs when an object (in this case, $storeCollection) is expected to have a method (getCollection()), but it actually doesn’t exist. The error happens on line 618 of your app/code/core/Mage/Core/Model/App.php file.

The relevant code snippet:

 /** @var $websiteCollection Mage_Core_Model_Store */
---> $storeCollection = Mage::getModel('core/store')->getCollection()
        ->initCache($this->getCache(), 'app', array(Mage_Core_Model_Store::CACHE_TAG))
        ->setLoadDefault(true);

The issue seems to be with the Mage::getModel('core/store') part. The Mage class is no longer available in Magento 2, and it appears you’re trying to use an outdated function.

Cause of the Problem

There could be several reasons for this error:

  1. Compatibility Issues: If you recently installed or uninstalled an extension, it might have left some residual code causing conflicts.

  2. Update Problems: Magento 1.7 is quite old now, and many extensions may not be compatible with such an outdated version.

  3. Core File Modifications: If you or a developer has manually modified the core files (which I don’t recommend), it could lead to unexpected behavior.

How to Resolve the Issue

Let’s go step by step:

  1. Check Your Magento Version: Make sure your site is indeed running on Magento 1.7.0.2. You can verify this in the ‘About’ page under ‘Admin Panel’ > ‘System’.

  2. Inspect Recent Changes: Review any recent updates, installations, or deletions of extensions and themes.

  3. Reinstall Core Files: If the issue persists, you might need to reinstall core files from a fresh Magento 1.7.0.2 download, excluding your custom modifications.

  4. Check Your Stores Configuration: Since you mentioned that Store 2 is a symbolic link from Store 1 due to SSL certificate issues, ensure there are no conflicts or incorrect configurations between the two stores in the ‘System’ > ‘Store Settings’.

Best Practices

To avoid such errors in the future:

  • Always keep your Magento version up-to-date. Upgrades can be complex, but they often bring performance improvements and security patches.

  • Be cautious when installing third-party extensions. Make sure they are compatible with your current Magento version and test them thoroughly before deployment.

  • Avoid modifying core files if possible. If you need to make changes, use a child theme or module instead. This will ensure your modifications don’t get overwritten during updates.

Conclusion

The Call to a member function getCollection() on a non-object error typically arises from compatibility issues between extensions and Magento versions. By carefully inspecting recent changes, reinstalling core files if necessary, and following best practices for store configuration and extension installation, you should be able to resolve this issue and maintain a stable e-commerce platform.

Remember, keeping your Magento version up-to-date is crucial for optimal performance and security. If the upgrade process seems daunting, consider reaching out to professional Magento development services like those offered at Laravel Company.

Happy coding!

Magento 2 Magento 1 Cache Extensions

Our network