Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Path : app\code\local\KS\Dashboard\Block\Adminhtml\Dashboard\Tab\Members\All.php
- class KS_Dashboard_Block_Adminhtml_Dashboard_Tab_Members_All extends Mage_Adminhtml_Block_Dashboard_Grid
- {
- public function __construct()
- {
- parent::__construct();
- $this->setId('membersAllGrid');
- }
- protected function _prepareCollection()
- {
- $collection = Mage::getResourceModel('reports/customer_collection')
- ->addCustomerName();
- /* $storeFilter = 0;
- if ($this->getParam('store')) {
- $collection->addAttributeToFilter('store_id', $this->getParam('store'));
- $storeFilter = 1;
- } else if ($this->getParam('website')){
- $storeIds = Mage::app()->getWebsite($this->getParam('website'))->getStoreIds();
- $collection->addAttributeToFilter('store_id', array('in' => $storeIds));
- } else if ($this->getParam('group')){
- $storeIds = Mage::app()->getGroup($this->getParam('group'))->getStoreIds();
- $collection->addAttributeToFilter('store_id', array('in' => $storeIds));
- }
- $collection->addSumAvgTotals($storeFilter)
- ->orderByTotalAmount(); */
- $this->setCollection($collection);
- return parent::_prepareCollection();
- }
- protected function _prepareColumns()
- {
- $this->addColumn('name', array(
- 'header' => $this->__('Customer Name'),
- 'sortable' => false,
- 'index' => 'name'
- ));
- $this->addColumn('orders_count', array(
- 'header' => $this->__('Number of Orders'),
- 'sortable' => false,
- 'index' => 'orders_count',
- 'type' => 'number'
- ));
- $this->setFilterVisibility(false);
- $this->setPagerVisibility(false);
- return parent::_prepareColumns();
- }
- public function getRowUrl($row)
- {
- //return $this->getUrl('*/customer/edit', array('id'=>$row->getCustomerId()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement