【问题标题】:render my block of custom field on the customer account edit page in magento在 magento 的客户帐户编辑页面上呈现我的自定义字段块
【发布时间】:2018-09-08 05:20:31
【问题描述】:

我想使用我的块添加一些自定义字段。 问题是该块没有在表单标签内或提交按钮之前呈现(参见屏幕截图 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>

【问题讨论】:

    标签: magento magento-1.9


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

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

      1) 将 sn-p 放在模块的布局 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) 现在在您的新文件中,您可以放置​​自定义字段。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-05-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多