【发布时间】:2014-07-25 06:54:30
【问题描述】:
我在 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
【问题讨论】:
-
在 magento stackexchange 上检查这个 link 看起来很相似,可能对你有帮助
-
@TejaKorlapati 我认为它不会,但更像是这个...stackoverflow.com/questions/11235679/core-overrides-in-magento 虽然我正在检查您的链接..
标签: php magento magento-1.9