0

At the moment the My Account link is not being shown in my top header. I would like to have it shown when the customer is logged in. I am using the below code in customer.xml

<customer_logged_in>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</customer_logged_in>

I believe that the code is correct, but I guess it has previously been removed directly from a template file. In which template would it normally be defined?

0

in customer.xml at your theme before it is look like

 <default>
        <!-- Mage_Customer -->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
        </reference>
    </default>

Remove my account link from default tag to Customer_logged_in

<customer_logged_in>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
    </reference>
</customer_logged_in>

Change it with

After change at customer.xml

<default>
        <!-- Mage_Customer -->
        <reference name="top.links">

        </reference>
    </default>

<!--
Load this update on every page when customer is logged in
-->

<customer_logged_in>
    <reference name="top.links">
     <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
        <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
    </reference>
</customer_logged_in>

hope this will sure help you.

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.