Magento Admin Dashboard modification

Magento Admin Dashboard modification

September 21, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Admin Dashboard modification

The client’s issue stems from a calculation discrepancy between the Admin Dashboard and the Order report, where the ‘Revenue’ figure on the dashboard is actually displaying profit rather than actual sales revenue. This inconsistency arises from how Magento handles data calculations within its core files.

To address this, you have already taken the correct initial step by overriding the core file Totals.php in /app/code/core/Mage/Adminhtml/Block/Dashboard/ and placing it under /app/code/local/Mage/Adminhtml/Block/Dashboard/. This allows for local customization of the dashboard without affecting the original Magento functionality.

The problem lies in locating the correct variable to retrieve the actual revenue figure. Your current modifications are correctly adding a new element to the Admin Dashboard, but they aren’t pulling the desired data from the system.

To solve this issue, we need to understand where Magento retrieves and processes its total sales figures. The key is to look at how the Grid.php file in /app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/ generates the ‘Sales Total’ column for the order report table.

In your edited post, you’ve correctly identified that either of these values ($totals->getTotalIncomeAmount() or $totals->getTotalRevenueAmount()) would provide the necessary revenue figure. However, these variables are not being loaded in the Totals.php file where you’ve attempted your modifications.

To resolve this, we need to modify the core file Grid.php instead of Totals.php. Since Grid.php is responsible for generating the table rows for the order report, updating this file will ensure that the correct values are displayed both on the dashboard and in the reports.

Here’s a suggested approach:

  1. Override the Grid.php file by placing it under /app/code/local/Mage/Adminhtml/Block/Report/Sales/Sales/.
  2. Locate the code block where the ‘Sales Total’ column is defined (around line 40-50).
  3. Modify the index parameter of the ‘Sales Total’ column to reference a new field that will hold the actual revenue value.

Here’s an example of how you might update this section:

$this->addColumn('total_income_amount', array(
    'header'        => Mage::helper('sales')->__('Actual Revenue'),
    'type'          => 'currency',
    'currency_code' => $currencyCode,
    'index'         => 'revenue_amount',  // Update the index to reference a new field
    'total'         => 'sum',
    'sortable'      => false
));

You would need to create a new field called revenue_amount in your database, which can be populated with the actual revenue figures from each order.

Remember to clear the Magento cache after making these changes and reloading the dashboard. This will ensure that the modified file is utilized instead of the cached version.

In conclusion, to resolve the client’s issue, we need to override the Grid.php file in the Sales report block rather than the Totals.php file in the Admin Dashboard block. This modification allows us to tap into the correct variables used for generating the order report and apply them to the dashboard as well.

This solution not only addresses the immediate problem but also ensures that the client’s system maintains consistency between the Admin Dashboard and the Order reports, with accurate revenue figures displayed on both interfaces.

Database Admin Orders Errors

Our network