Magento 从customer adminhtml选项卡中删除字段

Magento 从customer adminhtml选项卡中删除字段,magento,adminhtml,magento-1.x,Magento,Adminhtml,Magento 1.x,我试图从Magento adminhtml>客户>管理客户>客户信息>帐户信息选项卡中删除两个字段,但似乎无法让Magento识别我所做的事情。至少,我看不出来 在要包含覆盖的自定义模块中,我有: 文件:app/code/community/MyCompany/Profile/Block/Adminhtml/Customer/Edit/Tab/Account.php class MyCompany_Profile_Block_Customer_Edit_Tab_Account extends M

我试图从Magento adminhtml>客户>管理客户>客户信息>帐户信息选项卡中删除两个字段,但似乎无法让Magento识别我所做的事情。至少,我看不出来

在要包含覆盖的自定义模块中,我有:

文件:app/code/community/MyCompany/Profile/Block/Adminhtml/Customer/Edit/Tab/Account.php

class MyCompany_Profile_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account
{

    /**
     * Form initiation modification
     */
    public function initForm()
    {
        die('hello world!');
    }
}
一旦我确认调用了上面的initForm方法,我将修改它以删除字段。然而,在这个关头,因为它甚至没有被调用,我首先关注的是我拥有的基本设置

文件:app/code/community/MyCompany/Profile/etc/config.xml

我不会让人丢骰子或任何错误。我假设有一些小但不平凡的项目我没有设置/调用

另外,我不想从Magento中删除客户属性,这就是为什么我试图从显示客户属性的adminhtml选项卡中抑制/删除客户属性


p.p.S.缓存已完全禁用,因此这不是配置缓存问题。

我刚刚浏览了一些Magento内容,发现了这个

以防万一,如果有人被类似的方法卡住,这可能会有所帮助

首先创建模块xml文件; 文件:/app/etc/modules/MyCompany\u Profile.xml

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <MyCompany_Profile>
            <active>true</active>
            <codePool>community</codePool>
            <version>1.0.0</version>
        </MyCompany_Profile>
    </modules>
</config>
现在我们可以创建我们的类

文件:/app/code/community/MyCompany/Profile/Block/Customer/Edit/Tab/Account.php

class MyCompany_Profile_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account
{

    /**
     * Form initiation modification
     */
    public function initForm()
    {
        die('hello world!');
    }
}
现在,如果您正在使用缓存,则需要清除它,因为Magento不会看到新生成的XML文件,因此无法读取和识别我们的模块和模块的config.XML


完成后,继续访问配置文件,屏幕上将显示Hello World。

将模块xml添加到app/etc/modules/folder?在开发环境中禁用Magento缓存。我还刷新了我的redis缓存并重新启动了nginx。这将被添加到一个现有的功能模块中,因此MyCompany_Profile.xml文件已经存在于app/etc/modules中。您能找到答案吗?@dchayka请查看我的答案。
<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <MyCompany_Profile>
            <version>1.0.0</version>
        </MyCompany_Profile>
    </modules>

    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <customer_edit_tab_account>
                        MyCompany_Profile_Block_Customer_Edit_Tab_Account
                    </customer_edit_tab_account>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>
class MyCompany_Profile_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account
{

    /**
     * Form initiation modification
     */
    public function initForm()
    {
        die('hello world!');
    }
}