0

I'm working on my e-commerce website and I have some trouble with the Header.

Can someone tell me please How to remove account button and replace with simple account|login links?

2
  • What's your Magento version? Commented May 16, 2016 at 2:25
  • Thanks for your reply this is my magento version 1.9.1.0
    – Mystery
    Commented May 16, 2016 at 14:05

1 Answer 1

0

In case you need to apply custom template only for Top Links, you can do it like this in your theme's local.xml:

<default>
    <reference name="top.links">

        <action method="setTemplate">
            <template>page/template/my_links.phtml</template>
        </action>

    </reference>
<default>

Then copy page/template/links.phtml and rename it to page/template/my_links.phtml and do whatever you need inside that new template file. For example you can add log-in & logout link add the below code:

 <?php if (Mage::helper('customer')->isLoggedIn() ): ?>
            <a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?php echo 'Log OUT'; ?></a>

    <?php 

else: ?>
        <a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>">SIGN IN</a>
    <?php 

endif; ?>

To add a custom link to Top Links via local.xml:

<reference name="top.links">
    <action method="addLink" translate="label title">
        <label>My Link</label>
        <url>path/to/page</url>
        <title>My link tooltip</title>
        <prepare>true</prepare>
        <urlParams/>
        <position>150</position>
        <liParams>id="my-custom-id"</liParams>
    </action>
</reference>
0

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.