0

Now I have a code

<?php echo $this->getChildHtml('topLinks') ?> 

which gives me some set of menus like Login, MyWishlist, My Account, Checkout, and Mycart. But, now i need to change the label of these above mentioned links. What should I do?

2

2 Answers 2

3

For login, logout and my account link you can create your own local.xml in your theme layout. And do something like below

    <?xml version="1.0"?>
<layout>
    <default>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Account(custom)</label><url helper="customer/getAccountUrl"/><title>My Account (custom)</title><prepare/><urlParams/><position>10</position></action>
        </reference>
        <reference name="top.links">

        </reference>
    </default>
    <customer_logged_in>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Log Out</label><url helper="customer/getLogoutUrl"/><title>My Log Out</title><prepare/><urlParams/><position>100</position></action>
        </reference>
    </customer_logged_in>
    <customer_logged_out>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Log In</label><url helper="customer/getLoginUrl"/><title>My Log In</title><prepare/><urlParams/><position>100</position></action>
        </reference>
    </customer_logged_out>
</layout>

The original code for this you can find in your layout customer.xml

For changing my cart and checkout link, you need to rewrite Mage_Checkout_Block_Links and then override its addCartLink() and addCheckoutLink() methods.

And for changing wishlist link you can rewrite Mage_Wishlist_Block_Links and then override its _createLabel function.

Please remember, never change in core files always override them in your own module and for layout changes do them in your local.xml in your theme layout.

1

You can just translate the label in your translation.

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.