Here is another simple but very powerful module. This one is more of a skeleton for your further work. It comes with configuration needed for you to be able to override Magento classes and methods. Be careful, in current module I overrided Mage_Catalog_Model_Product_Type_Grouped class and it’ isSalable($product) method as you will see in Example.php model class. You can see the result of it you go to product list view and look at some grouped product.
ActiveCodeline_Overrider module (extension) for MAGENTO
Important thing to keep in mind while overriding, function name like isSalable($product) and isSalable() is not the same. My module is tested on Magento 1.3, however on older Magento it reported error (PHP Strict Notice) due to change in function name. In older Magento versions, same function does not have “$product” parametar. Therefore, keep in mind that when you override a function you also need to watch on it’s parameters. This is more of a OOP related stuff than Magento.
In short, let’s say you have a scenario where you wish to hook on some action in Magento. Now imagine that hook does not exist. What do you do? Why not override a method, add a event dispatchers then call original method. Now you created a hooks in place that did not have them and you did not modified any core files.
Check out the module provided and you’ll have a clear picture on what I’m talking about.
Cheers…
