00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('grid');
00041 }
00042
00043 protected function _prepareCollection()
00044 {
00045
00046 $collection = Mage::getResourceModel('reports/customer_collection')
00047 ->addAttributeToSelect('firstname')
00048 ->addAttributeToSelect('lastname');
00049
00050 $this->setCollection($collection);
00051 return parent::_prepareCollection();
00052 }
00053
00054 protected function _afterLoadCollection()
00055 {
00056 $this->getCollection()->addCartInfo();
00057 }
00058
00059 protected function _prepareColumns()
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 }
00104
00105 }
00106