1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setId('grid');
41: }
42:
43: protected function _prepareCollection()
44: {
45:
46: $collection = Mage::getResourceModel('reports/customer_collection')
47: ->addAttributeToSelect('firstname')
48: ->addAttributeToSelect('lastname');
49:
50: $this->setCollection($collection);
51: return parent::_prepareCollection();
52: }
53:
54: protected function _afterLoadCollection()
55: {
56: $this->getCollection()->addCartInfo();
57: }
58:
59: protected function _prepareColumns()
60: {
61: $this->addColumn('entity_id', array(
62: 'header' =>Mage::helper('reports')->__('ID'),
63: 'width' =>'50px',
64: 'align' =>'right',
65: 'index' =>'entity_id'
66: ));
67:
68: $this->addColumn('firstname', array(
69: 'header' =>Mage::helper('reports')->__('First Name'),
70: 'index' =>'firstname'
71: ));
72:
73: $this->addColumn('lastname', array(
74: 'header' =>Mage::helper('reports')->__('Last Name'),
75: 'index' =>'lastname'
76: ));
77:
78: $this->addColumn('items', array(
79: 'header' =>Mage::helper('reports')->__('Items in Cart'),
80: 'width' =>'70px',
81: 'sortable' =>false,
82: 'align' =>'right',
83: 'index' =>'items'
84: ));
85:
86: $currencyCode = $this->getCurrentCurrencyCode();
87:
88: $this->addColumn('total', array(
89: 'header' =>Mage::helper('reports')->__('Total'),
90: 'width' =>'70px',
91: 'sortable' =>false,
92: 'type' =>'currency',
93: 'align' =>'right',
94: 'currency_code' => $currencyCode,
95: 'index' =>'total',
96: 'renderer' =>'adminhtml/report_grid_column_renderer_currency',
97: 'rate' => $this->getRate($currencyCode),
98: ));
99:
100: $this->setFilterVisibility(false);
101:
102: $this->addExportType('*/*/exportCustomerCsv', Mage::helper('reports')->__('CSV'));
103: $this->addExportType('*/*/exportCustomerExcel', Mage::helper('reports')->__('Excel XML'));
104:
105: return parent::_prepareColumns();
106: }
107:
108: }
109: