0

我想使用我的块添加一些自定义字段。问题是该块未在表单标记内或提交按钮之前呈现(参见屏幕截图 1)。

截图 1

这是在帐户编辑页面上呈现块的代码:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0.0">
    <customer_account_edit>
        <reference name="my.account.wrapper">
                    <block type="customfield/Register" name="customfield_registrationnnn" template="vss_customfield/register.phtml" />
        </reference>
    </customer_account_edit>
</layout>
4

2 回答 2

0

实际上,在帐户编辑表单中没有插入新/自定义字段的钩子/句柄。

您可以覆盖模块布局文件中的 customer/form/edit.phtml

1) 将以下代码段放入模块的布局 XML 中。

<customer_account_edit>
    <reference name="customer_edit">
        <action method="setTemplate">
            <template>yourModule/customer/form/edit.phtml</template>
        </action>
    </reference>
</customer_account_edit>

2)复制你的主题

客户/表格/edit.phtml

yourModule/customer/form/edit.phtml

3)现在在您的新文件中,您可以放置​​您的自定义字段。

于 2018-09-24T13:36:48.260 回答
0

只需在 =“magento 的模块名称”之前使用。您可以在 magento 之前插入您的代码

于 2018-09-12T05:42:47.413 回答