protected function _prepareCollection() { parent::_prepareCollection(); $this->setHourFilter(); $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); $this->setCustomerGroups(); $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); /** @var AW_Advancedreports_Model_Mysql4_Collection_Usergroups $collection */ $collection = Mage::getResourceModel('advancedreports/collection_usergroups'); $this->setCollection($collection); $date_from = $this->_getMysqlFromFormat($this->getFilter('report_from')); $date_to = $this->_getMysqlToFormat($this->getFilter('report_to')); $this->getCollection()->setDateFilter($date_from, $date_to)->setState(); $storeIds = $this->getStoreIds(); if (count($storeIds)) { $collection->setStoreFilter($storeIds); } $collection->addCustomerGroups(); $this->_helper()->setNeedMainTableAlias(true); $columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort); if (strcmp($columnId, 'usergroups') === 0) { $dir = $this->getParam($this->getVarNameDir(), $this->_defaultDir); $dir = strtolower($dir) == 'desc' ? 'asc' : 'desc'; $this->_columns[$columnId]->setDir($dir); $this->_setCollectionOrder($this->_columns[$columnId]); } $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); $this->addOrderItemsCount(); $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); $this->setCollection(Mage::getResourceModel('advancedreports/collection_dayofweek')); $this->_prepareAbstractCollection(); $this->getCollection()->setDayOfWeekFilter(); $this->_helper()->setNeedMainTableAlias(true); $this->_prepareData(); return $this; }
/** * Prepare report collection * @return AW_Advancedreports_Block_Advanced_Country_Grid */ protected function _prepareCollection() { parent::_prepareCollection(); $this->setCollection(Mage::getResourceModel('advancedreports/collection_country')); $this->_prepareAbstractCollection(); $this->getCollection()->addAddress(); $this->getCollection()->addOrderItemsCount(); $this->_helper()->setNeedMainTableAlias(true); $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); /** @var AW_Advancedreports_Model_Mysql4_Collection_Usergroups $collection */ $collection = Mage::getResourceModel('advancedreports/collection_usergroups'); $this->setCollection($collection); $date_from = $this->_getMysqlFromFormat($this->getFilter('report_from')); $date_to = $this->_getMysqlToFormat($this->getFilter('report_to')); $this->getCollection()->setDateFilter($date_from, $date_to)->setState(); $storeIds = $this->getStoreIds(); if (count($storeIds)) { $collection->setStoreFilter($storeIds); } $collection->addCustomerGroups(); $this->_helper()->setNeedMainTableAlias(true); $this->_prepareData(); return $this; }
protected function _prepareCollection() { parent::_prepareCollection(); /** @var AW_Advancedreports_Model_Mysql4_Collection_Bestsellers $collection */ $collection = Mage::getResourceModel('advancedreports/collection_bestsellers'); $this->setCollection($collection); $date_from = $this->_getMysqlFromFormat($this->getFilter('report_from')); $date_to = $this->_getMysqlToFormat($this->getFilter('report_to')); $this->getCollection()->setDateFilter($date_from, $date_to)->setState(); $storeIds = $this->getStoreIds(); if (count($storeIds)) { $this->setStoreFilter($storeIds); } $this->addOrderItems($this->getCustomOption('advancedreports_bestsellers_options_bestsellers_count')); $key = $this->getFilter('reload_key'); if ($key === 'qty') { $this->getCollection()->orderByQty(); } elseif ($key === 'total') { $this->getCollection()->orderByTotal(); } //echo $this->getCollection()->getSelect(); $this->_prepareData(); }
public function _prepareCollection() { parent::_prepareCollection(); $collection = $this->getCollection(); if (Mage::helper('advancedreports')->checkVersion('1.4.1.0')) { $orderTable = $this->getTable('sales_flat_order'); } else { $orderTable = $this->getTable('sales_order'); } $collection->getSelect()->reset(); $collection->getSelect()->from(array('e' => $orderTable), array('order_created_at' => 'created_at', 'order_id' => 'entity_id', 'order_increment_id' => 'increment_id')); # Add address data to query $this->_addAddress($collection); $date_from = $this->_getMysqlFromFormat($this->getFilter('report_from')); $date_to = $this->_getMysqlToFormat($this->getFilter('report_to')); $this->setDateFilter($date_from, $date_to)->setState(); if ($this->getRequest()->getParam('store')) { $storeIds = array($this->getParam('store')); } else { if ($this->getRequest()->getParam('website')) { $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds(); } else { if ($this->getRequest()->getParam('group')) { $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds(); } } } if (isset($storeIds)) { $this->setStoreFilter($storeIds); } $this->addOrderItems(); $this->_addManufacturer($collection); $this->_prepareData(); }
protected function _prepareCollection() { parent::_prepareCollection(); $this->setCollection(Mage::getModel('catalog/product')->getCollection()); $date_from = $this->_getMysqlFromFormat($this->getFilter('report_from')); $date_to = $this->_getMysqlToFormat($this->getFilter('report_to')); $this->setDateFilter($date_from, $date_to)->setState(); if ($this->getRequest()->getParam('store')) { $storeIds = array($this->getParam('store')); } else { if ($this->getRequest()->getParam('website')) { $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds(); } else { if ($this->getRequest()->getParam('group')) { $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds(); } } } if (isset($storeIds)) { $this->setStoreFilter($storeIds); } $this->addOrderItems(Mage::helper('advancedreports')->confBestsellersCount()); $key = $this->getFilter('reload_key'); if ($key === 'qty') { $this->orderByQty(); } elseif ($key === 'total') { $this->orderByTotal(); } $this->_prepareData(); }