我在 Magento 中覆盖 product-> type -> price.php 模型时遇到问题。
这是我的app/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<softweb_catalog>
<active>true</active>
<codepool>local</codepool>
</softweb_catalog>
</modules>
</config>
这是
app/code/local/Softweb/Catalog/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<softweb_catalog>
<version>0.1</version>
</softweb_catalog>
</modules>
<global>
<models>
<catalog>
<class>Softweb_Catalog_Model</class>
</catalog>
<catalog>
<rewrite>
<product_type_price>Softweb_Catalog_Model_Product_Type_Price</product_type_price>
</rewrite>
</catalog>
</models>
</global>
</config>
现在 Price.php 路径是app/code/local/Softweb/Catalog/Model/Product/Type/Price.php
class Softweb_Catalog_Model_Product_Type_Price extends Mage_Catalog_Model_Product_Type_Price
{
public function getPrice($product)
{
die('function called');
}
}
我不知道我错过了什么......
PS我正在使用magento 1.9.0.1