Change the Dashboard Graph in version 1.7/1.12 of Magento

Change the Dashboard Graph in version 1.7/1.12 of Magento

September 29, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Change the Dashboard Graph in version 1.7/1.12 of Magento

Customizing the Magento Dashboard Graph: A Step-by-Step Guide

In recent updates of Magento, the default behavior of the admin dashboard graph was modified to reflect invoiced orders only. While this is a useful metric for many businesses, it may not align with your specific order processing workflows and custom statuses.

If you’re using custom order statuses or handling orders outside of the built-in Magento invoice feature, you’ll likely want to adjust the dashboard graph to better represent your sales performance. In this post, we’ll walk through how to modify the admin dashboard to query for Processing and Invoiced orders, and optionally include a custom order status.

Understanding the Default Graph Behavior

Before diving into the modifications, let’s clarify what the default graph in Magento 1.7/1.12 shows:

  • It queries the sales_flat_order table for rows with a status of ‘invoiced’.
  • This is done in the /app/code/core/Mage/Adminhtml/Block/Dashboard/Tabs/Sales.php file, specifically in the _prepareChart() method.

Changing the Graph to Query Processing and Invoiced Orders

To modify the graph to include both Processing and Invoiced orders:

  1. Open the /app/code/core/Mage/Adminhtml/Block/Dashboard/Tabs/Sales.php file.
  2. Locate the _prepareChart() method.
  3. Change this line:
    $orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect(array('created_at', 'increment_id'))
        ->addAttributeToFilter('status', array('eq' => 'invoiced'));
    
    To:
    $orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect(array('created_at', 'increment_id'))
        ->addAttributeToFilter(array(
            array('attribute' => 'status', 'eq' => 'processing'),
            array('attribute' => 'status', 'eq' => 'invoiced')
        ));
    

This modification instructs Magento to query for orders with a status of either Processing or Invoiced.

Include Your Custom Order Status

For a more tailored approach, you can include your custom order status in the graph. Assuming your custom status is named ‘custom_status’:

  1. Open the /app/code/core/Mage/Adminhtml/Block/Dashboard/Tabs/Sales.php file.
  2. Change the modification above to:
    $orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect(array('created_at', 'increment_id'))
        ->addAttributeToFilter(array(
            array('attribute' => 'status', 'eq' => 'processing'),
            array('attribute' => 'status', 'eq' => 'invoiced'),
            array('attribute' => 'status', 'eq' => 'custom_status')
        ));
    

Flush the Cache

After making these changes, ensure you flush the Magento cache to see the updated graph:

  • Go to System > Cache Management.
  • Select all caches and click “Flush Magento Cache”.

You should now see your modified graph on the admin dashboard.

Best Practices for Customizing the Magento Dashboard

When modifying core files like this, it’s crucial to follow best practices in Magento development:

  1. Use Child Themes: While not applicable here, always use child themes or modules when overriding core functionality.
  2. Backup and Version Control: Always backup your site before making modifications and keep track of changes using version control systems.
  3. Test Thoroughly: Ensure the graph updates correctly by processing orders with different statuses.

Conclusion

Customizing the Magento admin dashboard to align with your specific order management workflows is a powerful way to improve visibility into your sales performance. By modifying the core sales block, you can create a tailored graph that reflects Processing, Invoiced, and custom order statuses.

Remember, this is an advanced modification that requires careful testing in a controlled environment. Always consult with a Magento developer or expert if you’re unsure about making changes to the core codebase.

For more information on Magento development best practices and customization techniques, visit Laravel Company.

Magento 1 Database Performance Admin

Our network