0

I would like to reorder the wishlist in top links through xml file not editing the

app\code\core\Mage\Wishlist\Block\Links.php

Wondering why below code does not work?

  <default>
        <reference name="top.links">
            <block type="wishlist/links" name="wishlist_link" />
            <action method="addLinkBlock"><blockName>wishlist_link</blockName><prepare/><urlParams/><position>100</position></action>
        </reference>
</default>
  • Can you please put under which block you are calling this action method? – Rohit Kundale Mar 18 '16 at 8:47
1

It is not working because there is no function addLinkBlock available in app\code\core\Mage\Wishlist\Block\Links.php this file/Class nor in it's parents class.

You can use AddLink action which you can find in app/code/core/Mage/Page/Block/Template/Links.php file.

You can use following

<default>
        <reference name="top.links">
              <action method="addLink" translate="label title"><label>Wishlist</label><url>wishlist</url><title>Wishlist</title><prepare/><urlParams/><position>100</position></action>
        </reference>
</default>

Hope it helps

  • Since I want this changes only in one of the store views. Changing the Links.php affects all other themes as well! Any hint? – Zinat Mar 18 '16 at 8:52
  • @Zinat Check i have updated answer – Rohit Kundale Mar 18 '16 at 8:59
  • You can use store handle in your layout xml. Put your changes in that store handle. So changes will affect particular store only. Check here – Rohit Kundale Mar 18 '16 at 9:03
  • Thanks Rohit. May you please help me with these <block type="checkout/links" name="checkout_cart_link"> <action method="addCartLink"><prepare/><urlParams/><position>20</position></action> <action method="addCheckoutLink"><prepare/><urlParams/><position>15</position></action> </block> too? – Zinat Mar 18 '16 at 9:18
  • What you want to do? Can you please tell?. If you want to set custom position then don't use <block type="checkout/links" name="checkout_cart_link">. Direct call your action with addLink function within <reference name="top.links">. You can check my answer example – Rohit Kundale Mar 18 '16 at 9:20

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.