Skip to content

Instantly share code, notes, and snippets.

@trueparallels
Forked from az-iar/fix-order-grid.php
Created June 6, 2017 12:06
Show Gist options
  • Save trueparallels/ddc794aac0b0556a594a0324c82546bc to your computer and use it in GitHub Desktop.
Save trueparallels/ddc794aac0b0556a594a0324c82546bc to your computer and use it in GitHub Desktop.
magento - fix missing order and invoice grid data
<?php
include_once 'abstract.php';
class FixOrderGrid extends Mage_Shell_Abstract
{
/**
* Run script
*
*/
public function run()
{
// repopulate order grid data
$orderIds = Mage::getResourceModel('sales/order_collection')->getAllIds();
Mage::getModel('sales/order')->getResource()->updateGridRecords($orderIds);
// repopulate invoice grid data
$invoiceIds = Mage::getResourceModel('sales/order_invoice_collection')->getAllIds();
Mage::getModel('sales/order_invoice')->getResource()->updateGridRecords($invoiceIds);
}
}
$shell = new FixOrderGrid();
$shell->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment