public function getCountTotals() { if (!$this->getTotals()) { $filterData = $this->getFilterData(); $totalsCollection = Mage::getResourceModel($this->getResourceCollectionName())->setPeriod($filterData->getData('period_type'))->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))->addStoreFilter($this->_getStoreIds())->setAggregatedColumns($this->_getAggregatedColumns())->isTotals(true); $this->_addOrderStatusFilter($totalsCollection, $filterData); if (count($totalsCollection->getItems()) < 1 || !$filterData->getData('from')) { $this->setTotals(new Varien_Object()); } else { foreach ($totalsCollection->getItems() as $item) { $this->setTotals($item); break; } } } return parent::getCountTotals(); }
public function getCountTotals() { $totals = $this->getGrandTotals()->getData(); if (parent::getCountTotals() && count($totals)) { return true; } else { return false; } }