Magento 如何覆盖自定义模块中的radio.phtml?
我创建了一个自定义模块,用于更改捆绑产品选项的模板,它位于Magento 如何覆盖自定义模块中的radio.phtml?,magento,Magento,我创建了一个自定义模块,用于更改捆绑产品选项的模板,它位于radio.phtml中 我现在在一个新主题上覆盖了radio.phtmlxxx/template/bundle/catalog/product/view/type/bundle/option/radio.phtml 但是我想把radio.pthml放进我的自定义模块文件夹,也就是 template/mycompany/mymodule/radio.phtml 我知道我可以使用在mymodule.xml布局中进行操作,但我如何知道收音机.
radio.phtml
中
我现在在一个新主题上覆盖了radio.phtml
xxx/template/bundle/catalog/product/view/type/bundle/option/radio.phtml
但是我想把radio.pthml
放进我的自定义模块文件夹,也就是
template/mycompany/mymodule/radio.phtml
我知道我可以使用
在mymodule.xml
布局中进行操作,但我如何知道
收音机.phtml的
名称?您需要重写此块,因为主题是在块中设置的
Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
你可以在这个函数中
protected function _construct()
{
$this->setTemplate('bundle/catalog/product/view/type/bundle/option/radio.phtml');
}
您可以像这样重写块模块
<global>
<blocks>
<bundle>
<rewrite>
<catalog_product_view_type_bundle_option_radio>Spacename_Modulname_Block_Adminhtml_Radio</catalog_product_view_type_bundle_option_radio>
</rewrite>
</bumdle>
</blocks>
</global>
您需要重写此块,因为主题是在块中设置的
Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
你可以在这个函数中
protected function _construct()
{
$this->setTemplate('bundle/catalog/product/view/type/bundle/option/radio.phtml');
}
您可以像这样重写块模块
<global>
<blocks>
<bundle>
<rewrite>
<catalog_product_view_type_bundle_option_radio>Spacename_Modulname_Block_Adminhtml_Radio</catalog_product_view_type_bundle_option_radio>
</rewrite>
</bumdle>
</blocks>
</global>
谢谢,config.xml应该是,而不是谢谢,config.xml应该是,而不是