I am trying to customize the catalog and sales/order grids in magento.
There are 3 ways I know, by which I can implement by custom logic on these grids:
- Multilevel inheritance
for example
class Mage_Adminhtml_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid{
...
...
}
and I use
class Royal_Marketplace_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid{
....
// override only the methods I want to customize
}
- Single inheritance by many classes
for example
class Mage_Adminhtml_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid{
...
...
}
and I use
class Royal_Marketplace_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid{
....
// reproduce all the functions
}
- Events n Observers
If I don't use events and observers for some reason, I have 2 questions:
- Is my understanding correct?
- Which one is better among the first two methods? (I think 1st method is preferable, but many say 2nd is better).