Category Archives: Customer

○ Describe the architecture of the customer module
○ Describe the role of customer addresses
○ Describe how to add, modify, and display customer attributes:
■ What is the structure of tables in which customer information is stored?
■ What is the customer resource model?
■ How is customer information validated?
■ How can customer-related email templates be manipulated?
■ What is the difference between shipping and billing addresses for a customer?
■ How does the number of shipping and billing address entities affect the frontend interface for customers?
■ How does customer information affect prices and taxes?
■ How can attributes be added to a customer address? How are custom
address attributes you added converted to an order address?
■ Can a customer be added to two customer groups at the same time?
These code references can be used as an entry point to find answers to the questions above:
■ Mage/Customer/etc/config.xml
■ Mage_Customer_Model_Customer
■ Mage_Customer_Model_Resource_Customer ■ Mage_Customer_Model_Customer_Address

Modifying Frontend Customer Account List Options

When it comes to customer options, sometimes it is good to give them what they want, worth considering however is limiting the list to what you want them to want, and what is actually available.

By default a customer is likely to get something like the following options:

Customer Account Option Links

This is often far from desirable, and in those situations it is good to remove those choices that simply do not make sense for your installation.

One way of achieving this is with an extension.

Here are the instructional guidelines.

/app/etc/modules/{Namespace}_{Module}.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <{Namespace}_{Module}>
            <active>true</active>
            <codePool>local</codePool>
        </{Namespace}_{Module}>
    </modules>
</config>

/app/code/local/{Namespace}/{Module}/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <blocks>
            <customer>
                <rewrite>
                    <account_navigation>{Namespace}_{Module}_Block_Account_Navigation</account_navigation>
                </rewrite>
            </customer>
        </blocks>
    </global>
</config>

/app/code/local/{Namespace}/{Module}/Block/Account/Navigation.php

<?php

class {Namespace}_{Module}_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {

    public function removeLinkByName($name) {
        unset($this->_links[$name]);
    }
}

This is pretty much it, and sets up the environment for one last change.

In the /app/design/frontend/default/{theme/default}/layout/local.xml file, add immediately before the closing tag:

    <!--
               Customer Profile page
    -->
    <customer_account>
        <reference name="customer_account_navigation">
            <action method="removeLinkByName"><name>billing_agreements</name></action>
        </reference>
    </customer_account>

This will remove the Billing Agreements option. However, add from the following to remove other options that are not needed:

            <action method="removeLinkByName"><name>account</name></action>
            <action method="removeLinkByName"><name>account_edit</name></action>
            <action method="removeLinkByName"><name>address_book</name></action>
            <action method="removeLinkByName"><name>orders</name></action>
            <action method="removeLinkByName"><name>billing_agreements</name></action>            
            <action method="removeLinkByName"><name>recurring_profiles</name></action>
            <action method="removeLinkByName"><name>reviews</name></action>
            <action method="removeLinkByName"><name>tags</name></action>
            <action method="removeLinkByName"><name>downloadable_products</name></action>
            <action method="removeLinkByName"><name>wishlist</name></action>
            <action method="removeLinkByName"><name>newsletter</name></action>

Recurring Profiles =

<action method="removeLinkByName"><name>recurring_profiles</name></action>

My Product Reviews =

<action method="removeLinkByName"><name>reviews</name></action>

My Tags =

<action method="removeLinkByName"><name>tags</name></action>

My Applications =

<action method="removeLinkByName"><name>OAuth Customer Tokens</name></action>

My Downloadable Products =

<action method="removeLinkByName"><name>downloadable_products</name></action>

Resources:
Remove Billing Agreements and Recurring Profiles from Dashboard