0

In my Admin Panel under Customers --> Manage Customers --> click on a customer:

I want to remove "Billing Agreements and Recurring Profiles(beta)

enter image description here

app/code/local/Sean/CustomerNavigationLinks/etc/config.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Sean_CustomerNavigationLinks>
            <version>0.0.1</version>
        </Sean_CustomerNavigationLinks>
    </modules>
    <frontend>
        <layout>
            <updates>
                <customernavigationlinks>
                    <file>sean_customernavigationlinks.xml</file>
                </customernavigationlinks>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <customer>
                <rewrite>
                    <account_navigation>Sean_CustomerNavigationLinks_Block_Account_Navigation</account_navigation>
                </rewrite>
            </customer>
        </blocks>
        <helpers>
            <customernavigationlinks>
                <class>Sean_CustomerNavigationLinks_Helper</class>
            </customernavigationlinks>
        </helpers>
    </global>
</config>

app/code/Sean/CustomerNavigationLinks/Helper/Data.php :

<?php
class Sean_CustomerNavigationLinks_Helper_Data extends Mage_Core_Helper_Abstract
{

}

app/code/Sean/CustomerNavigationLinks/Block/Account :

<?php
class Sean_CustomerNavigationLinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation
{
    public function removeLinkByName($name)
    {
        unset($this->_links[$name]);
        return $this;
    }
}

app/design/frontend/base/default/layout/sean_customernavigationlinks.xml

<?xml version="1.0" ?>
<layout>
    <customer_account>
        <reference name="customer_account_navigation">
            <action method="removeLinkByName">
                <name>billing_agreements</name>
            </action>
            <action method="removeLinkByName">
                <name>recurring_profiles</name>
            </action>
        </reference>
    </customer_account>
</layout>

app/etc/modules/Sean_CustomerNavigationLinks.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Sean_CustomerNavigationLinks>
            <active>true</active>
            <codePool>local</codePool>
        </Sean_CustomerNavigationLinks>
    </modules>
</config>

The tabs are still there I'm not sure if I'm missing anything.

0

I think that you have developed a module that works with the front end of the site, and is designed to update the design view for the end user - when they log into the system.

At the start of your question, though, you mentioned that you wanted to have this removed in the admin section of the site - where you as an admin will log in.

In that case, you need to move from the front end <frontend> <layout> to adminhtml space.

Also, depending on what security patches you have in place, you'll also need to add in an ACL (access control layer) declaration in your XML, so that the admin user is able to view it with their login credentials.

I hope this steers you in the correct direction...

  • Hey Jeff, hmm you bring up a good point but where does recurring profiles and billing agreements even show in frontend? that does make sense tho that it would be in adminhtml instead. I just searched all my files for recurring profiles and found it in frontend – CodingMageSheen Feb 24 '17 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.