Question

I have to change the URL for "Placanje" link so it points to (http://localhost/darnik/customer/account/create/) instead of the current one. Please see the attachment with the template and block hints. enter image description here

the two links are added in class Mage_Page_Block_Template_Links but I don't know in which moment they are added, so that I can change the specifics for each one. How can I find where these links are added to the block?

I used this advice:

https://www.classyllama.com/blog/editing-magentos-top-links-the-better-way

and I managed to add another link in the top links which now points to /customer/account/create/. But I can't remove the old one "Placanje" which has URL /checkout I tried to use the <action method="removeLinkByUrl"><url>/checkout</url></action> but it won't remove it. Where else can I look to remove this?

Was it helpful?

Solution

Ok so the checkout link is set within checkout.xml:

<reference name="top.links">
        <block type="checkout/links" name="checkout_cart_link">
            <action method="addCartLink"></action>
            <action method="addCheckoutLink"></action>
        </block>
</reference>

So to remove this you could add below to your local.xml within the default node:

<reference name="top.links">
    <remove name="checkout_cart_link" />
</reference>

I have tested this and it worked for me but removed both the checkout and cart links in Magento 1.9.3.1 running the default RWD theme. I'm not sure you need the cart link in your theme but i overcome them both dissapearing with local.xml like below:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
   <default>
     <reference name="top.links">
       <remove name="checkout_cart_link" />
       <block type="checkout/links" name="checkout_cart_link_updated">
                <action method="addCartLink"></action>
        </block>
    </reference>
   </default>
</layout>

As stated in my comments there is a decent post about adding top links here:

http://www.classyllama.com/blog/editing-magentos-top-links-the-better-way

Am unsure why the remove by url is not working, did you try "checkout" rather than "/checkout"? This could be something to do with the actual url that is used for checkout not actually being checkout and being /checkout/onepage/index or something along those lines but now i'm just guessing.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top