0

I am using my own custom version of the RWD theme and want to remove the account button with the icon next to it and replace it with two simple account|login links that go to the account login/signup page.

Can anyone tell me how this can be achieved?

1 Answer 1

1

Try this in your local.xml

<?xml version="1.0"?>
<layout version="0.1.0">

    <default>


        <reference name="top.links">

            <!-- Remove cart, checkout and wishlist top links -->
            <remove name="checkout_cart_link" />
            <remove name="wishlist_link" />

            <!-- Remove my account top links -->
            <action method="removeLinkByUrl"><url helper="customer/getAccountUrl"/></action>

        </reference>

    </default>

        <!-- getting rid of login logout links in top .links -->
        <customer_logged_in>
            <reference name="top.links">
                <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action>
            </reference>
        </customer_logged_in>
        <customer_logged_out>
            <reference name="top.links">
                <action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action>
            </reference>
        </customer_logged_out>


</layout>

In your phtml use this

<ul>
                        <li>
                        <?php if(Mage::getSingleton('customer/session')->isLoggedIn()){ ?>
                        <?php
                        $customer = Mage::getSingleton('customer/session')->getCustomer();
                        $cusname = $customer->getFirstname().' '.$customer->getLastname();
                        $name = substr($cusname,0,18)."..";
                        ?>
                        <a href="<?php echo Mage::getUrl('checkout/cart'); ?>"><?php echo "Hi "."$name"  ?> &nbsp;</a>
                            <ul  class="subaccount">
                            <li><a href="<?php echo Mage::getUrl('customer/account'); ?>">Profile</a></li>
                            <li><a href="<?php echo Mage::getUrl('sales/order/history'); ?>">Order</a></li>
                            <li><a href="<?php echo Mage::getUrl('wishlist'); ?>">Wishlist</a></li>
                            <li><a href="<?php echo Mage::getUrl('newsletter/manage'); ?>">Newsletter</a></li>
                            <li><a href="<?php echo Mage::getUrl('review/customer'); ?>">Review</a></li>
                            <li><a href="<?php echo Mage::getUrl('customer/account/logout'); ?>">Logout</a></li>
                            </ul>
                        <?php } else { ?>
                        <a href="<?php echo Mage::getUrl('customer/account/login'); ?>">Login / Register</a>
                        <?php } ?>
                        </li>
                </ul>
15
  • But how do I remove the current account button first?
    – Oli Tuck
    Commented Mar 26, 2016 at 16:14
  • You want to remove Account from top link?
    – Magento 2
    Commented Mar 26, 2016 at 16:15
  • I want to remove the account button with the icon that has a dropdown, and just replace it with two simple links (account|login) that go to the account page.
    – Oli Tuck
    Commented Mar 26, 2016 at 16:28
  • Your answer just edited the items in the dropdown. I want to delete the account button all together. And replace it with something else
    – Oli Tuck
    Commented Mar 26, 2016 at 16:34
  • Can you please share your url or Update Screen shot
    – Magento 2
    Commented Mar 26, 2016 at 16:42

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.