Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?php
  2. class Kartparadigm_StoreCredit_Block_Adminhtml_Registries_Grid extends Mage_Adminhtml_Block_Widget_Grid
  3. {
  4. public function __construct(){
  5. parent::__construct();
  6. $this->setId('cardsGrid');
  7. $this->setDefaultSort('action_date');
  8. $this->setDefaultDir('DESC');
  9. $this->setSaveParametersInSession(true);
  10. }
  11.  
  12. protected function _prepareCollection(){
  13. $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection();
  14. $collection->getSelect()->join(array('refer' => 'customer_entity'),'refer.entity_id = main_table.c_id');
  15.  
  16. $this->setCollection($collection);
  17. return parent::_prepareCollection();
  18. }
  19.  
  20. protected function _prepareColumns()
  21. {
  22. $this->addColumn('c_id', array(
  23. 'header' => Mage::helper('kartparadigm_storecredit')->__('Customer Id'),
  24. 'index'=> 'c_id',
  25. 'sortable' => false,
  26. ));
  27.  
  28.  
  29. $this->addColumn('customer_name', array(
  30. 'header' => Mage::helper('kartparadigm_storecredit')->__('Customer Name'),
  31. 'index'=> 'customer_name',
  32. 'renderer' => 'Kartparadigm_Storecredit_Block_Adminhtml_Registries_Renderer_Customer',
  33. //'filter_condition_callback' => array($this, '_myCustomFilter'),
  34. ));
  35.  
  36.  
  37. $this->addColumn('email', array(
  38. 'header' => Mage::helper('kartparadigm_storecredit')->__('Customer Email'),
  39. 'index'=> 'email',
  40. 'sortable' => false,
  41. ));
  42.  
  43. $this->addColumn('action', array(
  44. 'header'=> Mage::helper('kartparadigm_storecredit')->__('Action On Credits'),
  45. 'index' => 'action',
  46. 'sortable' => false,
  47. ));
  48.  
  49. $this->addColumn('action credits', array(
  50. 'header'=> Mage::helper('kartparadigm_storecredit')->__('Credits Added'),
  51. 'index' => 'action_credits',
  52. 'sortable' => false,
  53. ));
  54.  
  55. $this->addColumn('credits', array(
  56. 'header'=> Mage::helper('kartparadigm_storecredit')->__('Total Credits'),
  57. 'index' => 'total_credits',
  58. 'sortable' => false,
  59. ));
  60.  
  61. $this->addColumn('action_date', array(
  62. 'header'=> Mage::helper('kartparadigm_storecredit')->__('Action Date'),
  63. 'index' => 'action_date',
  64. 'sortable' => false,
  65. 'type' =>'datetime'
  66. ));
  67.  
  68. $this->addColumn('custom_msg', array(
  69. 'header'=> Mage::helper('kartparadigm_storecredit')->__('Message'),
  70. 'index' => 'custom_msg',
  71. 'sortable' => false,
  72. ));
  73. return parent::_prepareColumns();
  74. }
  75.  
  76.  
  77. public function getRowUrl($row)
  78. {
  79. return $this->getUrl('*/*/showTransaction', array('id'=>$row->getId()));
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement