Im trying to rewrite the Mage_Review_Model_Resource_Review_Summary_Collection. The Module is activated. The folde structure is the same as in core review.
The problem should be in the xml.
My xml is:
<?xml version="1.0"?>
<config>
<modules>
<LM_Review>
<version>0.1.0</version>
</LM_Review>
</modules>
<frontend>
<routers>
<review>
<args>
<modules>
<lm_review before="Mage_Review">LM_Review</lm_review>
</modules>
</args>
</review>
</routers>
<layout>
<updates>
<lm_review>
<file>lm/review.xml</file>
</lm_review>
</updates>
</layout>
<translate>
<modules>
<LM_Review>
<files>
<default>LM_Review.csv</default>
</files>
</LM_Review>
</modules>
</translate>
</frontend>
<global>
<models>
<review_resource>
<rewrite>
<review_summary_collection>LM_Review_Model_Resource_Review_Summary_Collection</review_summary_collection>
</rewrite>
</review_resource>
</models>
</global>
</config>
LM_All.xml in etc/modules
<LM_Review>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Review />
</depends>
</LM_Review>
The Collection.php in app/code/local/LM/Review/Model/Resource/Review/Summary/Collection.php
class LM_Review_Model_Resource_Review_Summary_Collection extends Mage_Review_Model_Resource_Review_Summary_Collection {
public function addStoreFilter($storeId) {
die('test');
}
}
Your XML is correct. With the above XML in place, if you make the factory method call
Mage::getResourceModel('review/review_summary_collection')
Magento will attempt to instantiate a
LM_Review_Model_Resource_Review_Summary_Collection
That means
Magento can't see your module (no app/etc/module
file, or file is inactive, or file is pointing to the wrong code pool)
You do not have a file at LM/Review/Model/Resource/Review/Summary/Collection.php
in your code pool
The class defined in Collection.php
is not LM_Review_Model_Resource_Review_Summary_Collection
The class defined in Collection.php
does not extend Mage_Review_Model_Resource_Review_Summary_Collection
Check the spelling and upper/lower case of your class and path names. This matters to Magento.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With