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_Wishlist_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setId('wishlistReportGrid');
41: $this->setDefaultSort('entity_id');
42: $this->setDefaultDir('desc');
43: }
44:
45: protected function _prepareCollection()
46: {
47:
48: $collection = Mage::getResourceModel('reports/wishlist_product_collection')
49: ->addAttributeToSelect('entity_id')
50: ->addAttributeToSelect('name')
51: ->addWishlistCount();
52:
53: $this->setCollection($collection);
54:
55: parent::_prepareCollection();
56:
57: return $this;
58: }
59:
60: protected function _prepareColumns()
61: {
62: $this->addColumn('entity_id', array(
63: 'header' =>Mage::helper('reports')->__('ID'),
64: 'width' =>'50px',
65: 'index' =>'entity_id'
66: ));
67:
68: $this->addColumn('name', array(
69: 'header' =>Mage::helper('reports')->__('Name'),
70: 'index' =>'name'
71: ));
72:
73: $this->addColumn('wishlists', array(
74: 'header' =>Mage::helper('reports')->__('Wishlists'),
75: 'width' =>'50px',
76: 'align' =>'right',
77: 'index' =>'wishlists'
78: ));
79:
80: $this->addColumn('bought_from_wishlists', array(
81: 'header' =>Mage::helper('reports')->__('Bought from wishlists'),
82: 'width' =>'50px',
83: 'align' =>'right',
84: 'sortable' =>false,
85: 'index' =>'bought_from_wishlists'
86: ));
87:
88: $this->addColumn('w_vs_order', array(
89: 'header' =>Mage::helper('reports')->__('Wishlist vs. Regular Order'),
90: 'width' =>'50px',
91: 'align' =>'right',
92: 'sortable' =>false,
93: 'index' =>'w_vs_order'
94: ));
95:
96: $this->addColumn('num_deleted', array(
97: 'header' =>Mage::helper('reports')->__('Number of Times Deleted'),
98: 'width' =>'50px',
99: 'align' =>'right',
100: 'sortable' =>false,
101: 'index' =>'num_deleted'
102: ));
103:
104: $this->addExportType('*/*/exportWishlistCsv', Mage::helper('reports')->__('CSV'));
105: $this->addExportType('*/*/exportWishlistExcel', Mage::helper('reports')->__('Excel XML'));
106:
107: $this->setFilterVisibility(false);
108:
109: return parent::_prepareColumns();
110: }
111:
112: }
113:
114: