Magento-清除自定义帐户/注册字段
我随后在Magento下的客户注册表单中添加了字段,我成功地运行了该示例,但我知道它不干净,稍后升级 以干净的方式重写本教程中使用的所有文件的最佳方法是:Magento-清除自定义帐户/注册字段,magento,magento-1.4,Magento,Magento 1.4,我随后在Magento下的客户注册表单中添加了字段,我成功地运行了该示例,但我知道它不干净,稍后升级 以干净的方式重写本教程中使用的所有文件的最佳方法是: app/design/frontend/default/yourtheme/template/customer/form/register.phtml app/design/frontend/default/yourtheme/template/customer/form/edit.phtml app/code/core/Mage/Cust
- app/design/frontend/default/yourtheme/template/customer/form/register.phtml
- app/design/frontend/default/yourtheme/template/customer/form/edit.phtml
- app/code/core/Mage/Customer/Model/Entity/Setup.php
- app/code/core/Mage/Customer/etc/config.xml
- app/code/core/Mage/Customer/controllers/AccountController.php
非常感谢您需要创建自己的模块切勿编辑
app/code/core/
文件夹中的文件。如果要向Magento添加功能,需要重写基类
Alan Storm提供了很好的教程:
若要重写控制器(AccountController
,在您的情况下),并在创建自己的模块后,可以按照本教程进行操作
配置布局
在您的app/code/local/MyCompany/Module/etc/config.xml
中:
<?xml version="1.0"?>
<config>
<frontend>
<layout>
<updates>
<mydesign>
<file>myfile.xml</file>
</mydesign>
</updates>
</layout>
(...)
myfile.xml
(...)
然后,您可以在
app/design/frontend/default/mydesign/layout/myfile.xml
中更新布局。感谢您提供的好链接,joksnet,我已经用“模块创建者”创建了一个模块,我现在可以修改位于“\app\design\frontend\my_company\default\layout\customer.xml”中的xml文件来加载我的自定义phtml文件吗?我不知道怎么做“模块创建者”可以工作。但是请检查app/code/local/MyCompany/module/etc/config.XML中布局更新XML的配置,如我在回答中所述。