0

We are into the fine tuning process of our webshop. So I was scrolling down the customer profile page with my test account and I saw recurring profiles

I looked it up and we have decided we don't need it.Now the question:

How do I turn this off?

I found a thread of saying you have to manually disable this function. But I'd rather not manually destroy a function unless I really have to. So:

Could anyone tell me if I still need to disable this function manually, or if has a built in option to do that?

2
  • do u want to remove the billing agreement link and recurring profile link from the customer my account links ? Commented Nov 5, 2014 at 10:19
  • Yes, but without 'destroying' the code (if possible ofcourse).
    – GrayleBV
    Commented Nov 5, 2014 at 10:20

1 Answer 1

1

Create a small module for this.follow the following steps

Step 1: Create a xml file in the app/etc/modules/Neo_CustomerNavigationLinks.xml

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

Step 2: create a xml file in the app/code/local/Neo/CustomerNavigationLinks/etc/config.xml

<?xml version="1.0" ?> 
<config>
    <modules>
        <Neo_CustomerNavigationLinks>
            <version>0.0.1</version> 
        </Neo_CustomerNavigationLinks>
    </modules>
    <frontend>
        <layout>
            <updates>
                <customernavigationlinks>
                    <file>neo_customernavigationlinks.xml</file> 
                </customernavigationlinks>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <customer>
                <rewrite>
                    <account_navigation>Neo_CustomerNavigationLinks_Block_Account_Navigation</account_navigation> 
                </rewrite>
            </customer>
        </blocks>
        <helpers>
            <customernavigationlinks>
                <class>Neo_CustomerNavigationLinks_Helper</class> 
            </customernavigationlinks>
        </helpers>
    </global>
</config>

Step 3: Create app/code/local/Neo/CustomerNavigationLinks/Block/Account/Navigation.php

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

Step 4: Create app/code/local/Neo/CustomerNavigationLinks/Helper/Data.php

<?php
class Neo_CustomerNavigationLinks_Helper_Data extends Mage_Core_Helper_Abstract
{

}

Step 5: Create app/design/frontend/base/default/layout/neo_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>

Clear cache and see you have done.

25
  • Thanks, I will try this first! This probably answers that Magento still can't disable this option on its own.
    – GrayleBV
    Commented Nov 5, 2014 at 10:40
  • Ofcourse, I pressed [enter] too fast to add that to my comment ;)
    – GrayleBV
    Commented Nov 5, 2014 at 10:43
  • Does this extensions use the shopstandard language as reference to delete the right fields? Or are these fields standard Magento and doesn't it matter what they are called? Language is Dutch.
    – GrayleBV
    Commented Nov 5, 2014 at 11:16
  • it is not depened not use any other extensions.it take the name of the link which u want to remove and passes to the function and function removes the link thats it Commented Nov 5, 2014 at 11:21
  • A side note - you should not include closing ?> in PHP only files. See here. Commented Nov 5, 2014 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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