Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareCollection () | |
_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('gridProducts'); 00041 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 43 of file Grid.php.
00044 { 00045 $collection = Mage::getResourceModel('reports/product_collection') 00046 ->addAttributeToSelect('name') 00047 ->addAttributeToSelect('price') 00048 ->setStoreId('') 00049 ->addCartsCount() 00050 ->addOrdersCount() 00051 ->setSelectCountSqlType(Mage_Reports_Model_Mysql4_Product_Collection::SELECT_COUNT_SQL_TYPE_CART); 00052 /* @var $collection Mage_Reports_Model_Mysql4_Product_Collection */ 00053 00054 $this->setCollection($collection); 00055 return parent::_prepareCollection(); 00056 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 58 of file Grid.php.
00059 { 00060 $this->addColumn('entity_id', array( 00061 'header' =>Mage::helper('reports')->__('ID'), 00062 'width' =>'50px', 00063 'align' =>'right', 00064 'index' =>'entity_id' 00065 )); 00066 00067 $this->addColumn('name', array( 00068 'header' =>Mage::helper('reports')->__('Product Name'), 00069 'index' =>'name' 00070 )); 00071 00072 $this->addColumn('price', array( 00073 'header' =>Mage::helper('reports')->__('Price'), 00074 'width' =>'80px', 00075 'type' =>'currency', 00076 'currency_code' => $this->getCurrentCurrencyCode(), 00077 'index' =>'price', 00078 'renderer' =>'adminhtml/report_grid_column_renderer_currency' 00079 )); 00080 00081 $this->addColumn('carts', array( 00082 'header' =>Mage::helper('reports')->__('Carts'), 00083 'width' =>'80px', 00084 'align' =>'right', 00085 'index' =>'carts' 00086 )); 00087 00088 $this->addColumn('orders', array( 00089 'header' =>Mage::helper('reports')->__('Orders'), 00090 'width' =>'80px', 00091 'align' =>'right', 00092 'index' =>'orders' 00093 )); 00094 00095 $this->setFilterVisibility(false); 00096 00097 $this->addExportType('*/*/exportProductCsv', Mage::helper('reports')->__('CSV')); 00098 $this->addExportType('*/*/exportProductExcel', Mage::helper('reports')->__('Excel')); 00099 00100 return parent::_prepareColumns(); 00101 }