*/ class Mage_Adminhtml_Helper_Dashboard_Order extends Mage_Adminhtml_Helper_Dashboard_Abstract { protected function _initCollection() { $isFilter = $this->getParam('store') || $this->getParam('website') || $this->getParam('group'); $this->_collection = Mage::getResourceSingleton('reports/order_collection') ->prepareSummary($this->getParam('period'), 0, 0, $isFilter); if ($this->getParam('store')) { $this->_collection->addFieldToFilter('store_id', $this->getParam('store')); } else if ($this->getParam('website')){ $storeIds = Mage::app()->getWebsite($this->getParam('website'))->getStoreIds(); $this->_collection->addFieldToFilter('store_id', array('in' => implode(',', $storeIds))); } else if ($this->getParam('group')){ $storeIds = Mage::app()->getGroup($this->getParam('group'))->getStoreIds(); $this->_collection->addFieldToFilter('store_id', array('in' => implode(',', $storeIds))); } elseif (!$this->_collection->isLive()) { $this->_collection->addFieldToFilter('store_id', array('eq' => Mage::app()->getStore(Mage_Core_Model_Store::ADMIN_CODE)->getId()) ); } $this->_collection->load(); } }