Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareCollection () | |
_afterLoadCollection () | |
_prepareColumns () |
Definition at line 34 of file Grid.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 37 of file Grid.php.
00038 { 00039 parent::__construct(); 00040 $this->setId('grid'); 00041 }
_afterLoadCollection | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 54 of file Grid.php.
00055 { 00056 $this->getCollection()->addCartInfo(); 00057 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 43 of file Grid.php.
00044 { 00045 //TODO: add full name logic 00046 $collection = Mage::getResourceModel('reports/customer_collection') 00047 ->addAttributeToSelect('firstname') 00048 ->addAttributeToSelect('lastname'); 00049 00050 $this->setCollection($collection); 00051 return parent::_prepareCollection(); 00052 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 59 of file Grid.php.
00060 { 00061 $this->addColumn('entity_id', array( 00062 'header' =>Mage::helper('reports')->__('ID'), 00063 'width' =>'50px', 00064 'align' =>'right', 00065 'index' =>'entity_id' 00066 )); 00067 00068 $this->addColumn('firstname', array( 00069 'header' =>Mage::helper('reports')->__('First Name'), 00070 'index' =>'firstname' 00071 )); 00072 00073 $this->addColumn('lastname', array( 00074 'header' =>Mage::helper('reports')->__('Last Name'), 00075 'index' =>'lastname' 00076 )); 00077 00078 $this->addColumn('items', array( 00079 'header' =>Mage::helper('reports')->__('Items in Cart'), 00080 'width' =>'70px', 00081 'sortable' =>false, 00082 'align' =>'right', 00083 'index' =>'items' 00084 )); 00085 00086 $this->addColumn('total', array( 00087 'header' =>Mage::helper('reports')->__('Total'), 00088 'width' =>'70px', 00089 'sortable' =>false, 00090 'type' =>'currency', 00091 'align' =>'right', 00092 'currency_code' => $this->getCurrentCurrencyCode(), 00093 'index' =>'total', 00094 'renderer' =>'adminhtml/report_grid_column_renderer_currency' 00095 )); 00096 00097 $this->setFilterVisibility(false); 00098 00099 $this->addExportType('*/*/exportCustomerCsv', Mage::helper('reports')->__('CSV')); 00100 $this->addExportType('*/*/exportCustomerExcel', Mage::helper('reports')->__('Excel')); 00101 00102 return parent::_prepareColumns(); 00103 }