It seems critical updating from local.xml in magento
How can it be solved?I want to 'My Cart' link not in top menu, rather in other place. So I deleted from checkout.xml:
<reference name="top.links">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCheckoutLink"></action>
</block>
</reference>
Then add new reference:
<reference name="top.mybasket">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCartLink"></action>
</block>
</reference>
From page.xml i add this:
<block type="开发者_StackOverflowpage/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
// other blocks
<block type="page/template_links" name="top.mybasket" as="my_basket_count"/>
</block>
Next i add in header.phtml by:
<?php echo $this->getChildHtml('my_basket_count') ?>
All works fine. My question is how this whole process can be done in local.xml? I tried but it looks critical!
Here is the content of local.xml you need if i understand correctly your requirements:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="top.links">
<remove name="checkout_cart_link"/>
</reference>
<reference name="root">
<reference name="header">
<block type="page/template_links" name="top.mybasket" as="my_basket_count"/>
</reference>
</reference>
<reference name="top.mybasket">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCartLink"></action>
</block>
</reference>
</default>
</layout>
精彩评论