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_Wishlist_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('wishlistReportGrid');
00041 $this->setDefaultSort('entity_id');
00042 $this->setDefaultDir('desc');
00043 }
00044
00045 protected function _prepareCollection()
00046 {
00047
00048 $collection = Mage::getResourceModel('reports/wishlist_product_collection')
00049 ->addAttributeToSelect('entity_id')
00050 ->addAttributeToSelect('name')
00051 ->addWishlistCount();
00052
00053 $this->setCollection($collection);
00054
00055 parent::_prepareCollection();
00056
00057 return $this;
00058 }
00059
00060 protected function _prepareColumns()
00061 {
00062 $this->addColumn('entity_id', array(
00063 'header' =>Mage::helper('reports')->__('ID'),
00064 'width' =>'50px',
00065 'index' =>'entity_id'
00066 ));
00067
00068 $this->addColumn('name', array(
00069 'header' =>Mage::helper('reports')->__('Name'),
00070 'index' =>'name'
00071 ));
00072
00073 $this->addColumn('wishlists', array(
00074 'header' =>Mage::helper('reports')->__('Wishlists'),
00075 'width' =>'50px',
00076 'align' =>'right',
00077 'index' =>'wishlists'
00078 ));
00079
00080 $this->addColumn('bought_from_wishlists', array(
00081 'header' =>Mage::helper('reports')->__('Bought from wishlists'),
00082 'width' =>'50px',
00083 'align' =>'right',
00084 'sortable' =>false,
00085 'index' =>'bought_from_wishlists'
00086 ));
00087
00088 $this->addColumn('w_vs_order', array(
00089 'header' =>Mage::helper('reports')->__('Wishlist vs. Regular Order'),
00090 'width' =>'50px',
00091 'align' =>'right',
00092 'sortable' =>false,
00093 'index' =>'w_vs_order'
00094 ));
00095
00096 $this->addColumn('num_deleted', array(
00097 'header' =>Mage::helper('reports')->__('Number of times deleted'),
00098 'width' =>'50px',
00099 'align' =>'right',
00100 'sortable' =>false,
00101 'index' =>'num_deleted'
00102 ));
00103
00104 $this->addExportType('*/*/exportWishlistCsv', Mage::helper('reports')->__('CSV'));
00105 $this->addExportType('*/*/exportWishlistExcel', Mage::helper('reports')->__('Excel'));
00106
00107 $this->setFilterVisibility(false);
00108
00109 return parent::_prepareColumns();
00110 }
00111
00112 }
00113