如何解决Magento:在我的自定义产品类型中添加一个自定义view.phtml
|| 因此,我创建了一个自定义的view.phtml文件,以在产品页面上显示其他布局以进行事件注册。如果将其添加到“设计”选项卡下的XML字段中,则可以显示该自定义视图文件。 我想要做的是在magento中创建一个自定义产品类型,该产品类型已经使用了我的新view-events.phtml。我知道如何创建自定义产品类型,但是如何获取新产品类型以使用我的自定义视图文件?解决方法
在您模块的config.xml中:
<config>
<global>
<catalog>
<product>
<type>
<!-- Change \"custom\" to your custom product type -->
<custom>
<!-- See app/code/core/Mage/Catalog/etc/config.xml for hints here -->
</custom>
</type>
</product>
</catalog>
</global>
<frontend>
<layout>
<updates>
<!-- Use your module\'s name here -->
<your_module>
<file>your_module.xml</file>
</your_module>
</updates>
</layout>
</frontend>
然后在刚才引用的your_module.xml布局文件中:
<layout>
<PRODUCT_TYPE_custom>
<reference name=\"product.info\">
<action method=\"setTemplate\">
<template>path/to/your/view-events.phtml</template>
</action>
</reference>
</PRODUCT_TYPE_custom>
</layout>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。