我试图重写 Mage_Review_Model_Resource_Review_Summary_Collection。模块被激活。折叠结构与核心审查中的相同。
问题应该在xml中。
我的xml是:
<?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>
etc/modules 中的 LM_All.xml
<LM_Review>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Review />
</depends>
</LM_Review>
app/code/local/LM/Review/Model/Resource/Review/Summary/Collection.php 中的 Collection.php
class LM_Review_Model_Resource_Review_Summary_Collection extends Mage_Review_Model_Resource_Review_Summary_Collection {
public function addStoreFilter($storeId) {
die('test');
}
}