0

I've eliminated all of my top links with the exception of:

Login

My Cart

I've done this by commenting out the appropriate sections in my themes customer.xml file.

Now what I would like to do is have the following display when the customer logs in:

My Account

Compare

Wish list

I have tried to place the layout information as follows for My Account however I haven't be able to get it to work:

  <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>10</position></action>
<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>

How can I display the customer specific links only when they are logged in?

  • Seams like you are in the right track. everything you place in the layout handle customer_logged_in will be loaded only when the customer is logged in. You should place there your links. – Marius Apr 24 '14 at 13:38
  • Looks like you are correct Marius! I have no idea why it wasn't working but none the less, I couldn't find anything specific about this when I was searching so I'll leave it be and others can benefit. SR – SR_Magento Apr 24 '14 at 16:04
  • Just so this question would have an answer, please post the final form of your xml layout file as an answer and accept it. – Marius Apr 24 '14 at 20:33
  • I've answered it but unfortunately I have to wait 2 days. – SR_Magento Apr 24 '14 at 20:42
0

My final xml modifications are the following:

    <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>10</position></action>
        <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">
        <label>Compare</label>
        <url>catalog/product_compare/index/</url>
        <title>Compare</title>
        <prepare>false</prepare>
        <position>20</position>
        <target>_blank</target>
</action>
    </reference>
</customer_logged_in>

This will show only Log Out, My Account and Compare in the top links menu for customers that are logged in. When logged out only Login.

Note: I have the wishlist disabled in the admin panel.

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.