Another way of doing it is by creating a small module (available here: https://github.com/digitalpianism/easytoplinks)
app/etc/modules/DigitalPianism_EasyToplinks.xml
<?xml version="1.0"?>
<config>
<modules>
<DigitalPianism_EasyToplinks>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Page/>
</depends>
</DigitalPianism_EasyToplinks>
</modules>
</config>
app/code/local/FactoryX/EasyToplinks/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<DigitalPianism_EasyToplinks>
<version>0.0.5</version>
</DigitalPianism_EasyToplinks>
</modules>
<global>
<blocks>
<page>
<!--
Mage_Page_Block_Template_Links
-->
<rewrite>
<template_links>DigitalPianism_EasyToplinks_Block_Page_Template_Links</template_links>
</rewrite>
</page>
</blocks>
</global>
</config>
app/code/local/FactoryX/EasyToplinks/Block/Page/Template/Links.php
<?php
/**
* Class DigitalPianism_EasyToplinks_Block_Page_Template_Links
*/
class DigitalPianism_EasyToplinks_Block_Page_Template_Links extends Mage_Page_Block_Template_Links
{
/**
* Change the position of an existing to make the layout customization easier
* @param string $url
* @param int $position
* @return $this
*/
public function setPosition($url, $position)
{
// Get the link and delete it from the current position
foreach ($this->_links as $k => $v) {
if ($v->getUrl() == $url) {
$link = $this->_links[$k];
unset($this->_links[$k]);
}
}
if (isset($link)) {
// Add link to new position
$this->_addIntoPosition($link, $position);
}
return $this;
}
}
Now that you have this module you can change the position easily via the layout by using:
<reference name="top.links">
<action method="setPosition">
<url>checkout/cart</url>
<position>99</position>
</action>
</reference>