Fatal error: Call to a member function setFinalPrice() on a non-object?

Fatal error: Call to a member function setFinalPrice() on a non-object?

August 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Fatal error: Call to a member function setFinalPrice() on a non-object?

Resolving the “Call to a member function setFinalPrice() on a non-object” Error in Magento

As a seasoned developer, I often encounter issues like this when working with Magento extensions. The error message suggests that there’s a problem with an object reference somewhere in your codebase. Let me guide you through diagnosing and resolving this issue.

Understanding the Error

The core of this problem lies within the Mage_Sales_Model_Quote_Item_Abstract class, specifically at line 73:

$item->setFinalPrice($final_price);

This line is attempting to call the setFinalPrice() method on an object referenced by $item. The error occurs when $item has not been initialized or has been set to null.

Pinpointing the Cause

In your case, you mentioned installing a third-party extension called “ajax pro.” This extension likely introduced the issue. Even after removing its files and folders, residual changes in the database or core Magento files could still cause this problem.

Let’s explore some common culprits:

  1. Database Changes: The extension might have added new fields to existing tables that were not properly handled during uninstallation.
  2. Core File Overrides: If the extension used copy to override core files, those changes may still be present even after deletion.
  3. Cached Data: Although you mentioned clearing cache, it’s worth checking for any cached data related to the extension.

Steps to Resolve

I recommend following a systematic approach:

1. Check Database Changes

Use phpMyAdmin or your preferred MySQL client to inspect the catalog_product_entity and sales_flattened_rate tables (commonly affected by price-related issues). Look for any unexpected fields or data.

If you find any, use the following SQL commands:

DELETE FROM catalog_product_entity_int WHERE attribute_id = <affected_field_id>;
UPDATE catalog_product_entity SET custom_options = NULL;

Replace <affected_field_id> with the actual ID of the problematic field.

2. Inspect Core File Overrides

Navigate to your Magento root directory and check for any residual changes in the app/code/core/ directories, especially under Mage_Sales and Mage_Checkout.

Look for any modified or renamed files compared to a fresh Magento installation. If you find any, restore them from a clean backup.

3. Clear All Cache Manually

While Magento provides a cache management interface, let’s manually clear some key folders:

rm -rf var/cache/*
rm -rf var/session/*
rm -rf var/tmp/*
chmod 777 var/locks/cron.lock

This ensures all cache is completely wiped.

Conclusion

Resolving this issue requires a combination of database cleanup and file inspection. Remember that third-party extensions can introduce hidden dependencies and changes, even after removal.

If you’re still experiencing problems after following these steps, consider reaching out to the extension developer for support or contacting Magento’s official support channels.

In cases where you find yourself frequently debugging similar issues, I recommend using a dedicated development environment at https://laravelcompany.com/ where you can safely test and experiment without affecting your production site.

Cache Database Extensions Pricing

Our network