I want to change a single line of code in a single method in e.g. the class Mage_Reports_Model_Resource_Product_Collection. The easiest way seems to be to copy the entire class file to app/code/local/..., but then I have replaced the original class, not overridden a method.
How can I create a new class that inherits from e.g. Mage_Reports_Model_Resource_Product_Collection and only override one method? And still tell Magento to use my new class instead of the original.
Here’s the working code to rewrite product collection:
It should work for
Mage::getResourceModel('reports/product_collection')call.Yeah and I haven’t included the
<config>tag, I think you should already have even<global>one, so I felt it wasn’t necessary.