How to add Wishlist in Magento toplinks menu for only logged in user

Here is the simple method to add wishlist only for loggedin user in magento.
just go to your layout page that is app/design/frontend/PACKAGE7THEME/layout/local.xml and add following code

<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>
            <action method="addLink" translate="label title" module="wishlist"><label>My Wishlist</label><path>wishlist</path><title>My Wishlist</title><prepare>true</prepare><urlParams/><position>110</position></action>
        </reference>
    </customer_logged_in>
    <customer_logged_out>
        <reference name="top.links">
            <remove name="wishlist_link"/>
        </reference>
    </customer_logged_out>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.