I want to exclude orders with a certain attribute set from the chart on the dashboard. I started looking in Mage_Adminhtml_Block_Dashboard_Graph
but somehow I can't find the place. Any advice?
1 Answer
Due to the abstraction that is added to that part of the admin, it can be indeed a bit tricky to find the actual code which is responsible for loading the orders.
Deeper in the code the Mage_Adminhtml_Block_Dashboard_Tab_Orders
block is being loaded. This block will eventually load a helper for fetching data. In this case that is the Mage_Adminhtml_Helper_Dashboard_Order
helper, in which you can find the _initCollection()
method.
If you extend this helper from your own module, you can adjust the collection filtering to ignore the orders you want to exclude.
If you need more information on how to filter collections, the following link is a great source: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/using_collections_in_magento.
Good luck!