0

I want to change the text of My account top links.

When user is not logged in, I need to display the top link My Account as Register.

Once a user is logged in, I want to change that text to from Register to 'Your account'.

How can I achieve this ?

Please Help.

Thanks.

2

As mentioned before you can edit your local.xml file. It should be in your theme folder e.g.: app/design/frontend/yourpackage/yourversion/layout/local.xml If it´s not there you can create it. It`s a very good way to edit the layout xml for a theme.

Remove "My Account" for the default handle

<default>
    <reference name="top.links">
        <action method="removeLinkByUrl">
            <url helper="customer/getAccountUrl"/>
        </action>
    </reference>
 </default>

Add "Register" for the logged out handle

<customer_logged_out>
    <reference name="top.links">
        <action method="addLink" translate="label title">
            <label>Register</label>
            <url helper="customer/getLogInUrl"/>
            <prepare/>
            <urlParams/>
        </action>
    </reference>
</customer_logged_out>

Add "My Account" for the logged in handle

<customer_logged_in>
    <reference name="top.links">
        <action method="addLink" translate="label title">
            <label>Your Account</label>
            <url helper="customer/getAccountUrl" />
            <prepare/>
            <urlParams/>
            <liParams>
                <id>header-account-link</id>
            </liParams>
            <aParams/>
            <beforeText/>
            <afterText/>                 
        </action>
    </reference>
</customer_logged_in>

In app/design/frontend/base/default/layout/customer.xml you can find the possible handles and url helper etc.

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.