Magento에서 모델 재 작성에 문제가 있습니다. 두 개의 사용자 정의 모듈은, 첫 번째 모듈의 Config.xml의 나는 또한 내가Magento 모델 다시 쓰기가 작동하지 않습니다.
<blocks>
<callforprice>
<class>Atwix_CallForPrice_Block</class>
</callforprice>
<catalog>
<rewrite>
<product_list>Atwix_CallForPrice_Block_Product_List</product_list>
</rewrite>
</catalog>
</blocks>
getAddToCartUrl가 재 작성했다 함수 코어 블록을 다시 썼다
<models>
<callforprice>
<class>Atwix_CallForPrice_Model</class>
</callforprice>
<catalog>
<rewrite>
<product>Atwix_CallForPrice_Model_Saleable</product>
</rewrite>
</catalog>
</models>
핵심 모델을 다시 썼다가있어,이 기능을 쇼핑 카트에 담기 "변경 "버튼의 URL. 이 모듈에서는 잘 작동합니다. 하지만 새로운 맞춤 모듈을 만들고 함수를 호출했을 때
$collection = Mage::getModel('catalog/product')->getCollection();
나는 버튼의 URL을 필요로하지 않았다. 재 작성된 것 같으면 작동하지 않습니다. 버튼에는 여전히 핵심 URL이 있습니다. 저는 Atwix_CallForPrice_Block_Product_List에서 구문 분석 오류를 확인했기 때문에 그것을 알고 있습니다. 그리고 첫 번째 모듈의 경우 오류가 발생했습니다. 다른 경우에는 모두 정상적으로 작동합니다.
내 영어로 죄송합니다.
$ collection이 Mage_Catalog_Product 또는 Atwix_CallForPrice_Model_Saleable의 항목을 반환합니까? 그것은 당신의 문제의 근원 일 수 있습니다. –