I have upgraded my Magento CE platform from to and few days ago, I noticed that abandoned carts report is not updated with new carts. Where as I have checked in Customer Edit form, we can see all the items in shopping cart, also they are shown in sales_order_quote in Db, which means carts are being created, but they are not listed in reports.

I have tested it by creating a test customer account, and the problem is same. Any idea where in the code I should look for...?


  • I just figured out that if customer account is created before the up-gradation, it works perfect i.e: Their carts are shown in reports. The problem is only with new customer accounts... Jan 23, 2016 at 12:22

3 Answers 3


This is a magento core bug. What happens is, when customers are registered on website, the middle name attribute entity value is not created at the customer_entity_varchar table. The value should be NULL if the middle name is empty. But It will be created when you edit the customer from the admin panel.

FIX: Override "app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php" by copying it to local path "app/code/local/Mage/Reports/Model/Resource/Quote/Collection.php"

And change line 209 from "joinInner" to "joinLeft" will solve the problem.

  • It's important to flush Magento cache too
    – WaPoNe
    Sep 14, 2016 at 10:27
  • just upgraded to magento ver Any idea why this bug hasn't been fixed in the core yet? Not really too keen on overwriting core files.
    – frshjb373
    Aug 30, 2017 at 20:06
  • That worked right away
    – Arnie
    Aug 20, 2019 at 10:21

Solutions: Yes this is known bug caused by the middle name attribute in recent versions of Magento. Here is the solution for this issue, we need to insert records for middle name attribute for old customers, here is the script to update database table

require 'app/Mage.php';

$db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();

$sql = 'SELECT entity_id FROM ' . $tablePrefix .'customer_entity where entity_id NOT IN (SELECT entity_id FROM '. $tablePrefix.'customer_entity_varchar where attribute_id = 6)';

$db_write1= Mage::getSingleton('core/resource')->getConnection('core_write');
echo "<br>Total: ".count($value);
$i =1;
while ($row = $value->fetch())
    echo "<br>".$i." - ".$row['entity_id'];
    $sql = 'INSERT INTO '. $tablePrefix.'customer_entity_varchar (entity_type_id, attribute_id, entity_id) VALUES (1, 6, '.$row['entity_id'].' )';
  • 1
    This saved my life today :3 Jun 26, 2019 at 9:20
  • Thanks @KeenoraFluffball , and I am happy that my post helped you in resolving your problem! Jul 3, 2019 at 10:51

Yes this is known bug caused by the middle name attribute in recent versions of Magento.

I could not find better than this post (see the comment of the answer)

Get all abandoned carts in Magento

I know there's a proper fix somewhere I just can't get my hands on it, will update my answer when I find it

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