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?

  • What's your Magento version? – Khoa TruongDinh May 16 '16 at 2:25
  • Thanks for your reply this is my magento version 1.9.1.0 – Mystery May 16 '16 at 14:05
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>

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.