You are viewing an old revision of this post, from December 7, 2016 @ 17:15:44. See below for differences between this version and the current revision.

Magento – Abandoned carts report doesn’t work

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';
Mage::app('default');

$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');
$value=$db_read->query($sql);
echo "<br>Total: ".count($value);
$i =1;
while ($row = $value->fetch())
{
    //print_r($row);
    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'].' )';
    $db_write1->query($sql);  
};

Revisions

  • December 7, 2016 @ 17:15:44 [Current Revision] by admin
  • December 7, 2016 @ 17:15:44 by admin

Revision Differences

There are no differences between the December 7, 2016 @ 17:15:44 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply