Php 如何使用自定义模块覆盖minicart phtml文件
我正在尝试覆盖minicart phtml文件, 在config.xml中使用了此代码->Php 如何使用自定义模块覆盖minicart phtml文件,php,magento,shopping-cart,magento-1.9,Php,Magento,Shopping Cart,Magento 1.9,我正在尝试覆盖minicart phtml文件, 在config.xml中使用了此代码-> <layout> <updates> <rakesh_webr module="Webr"> <file>webr.xml</file> </rakesh_webr> </updates> </layout> webr.xml 这在我
<layout>
<updates>
<rakesh_webr module="Webr">
<file>webr.xml</file>
</rakesh_webr>
</updates>
</layout>
webr.xml
这在我的布局配置文件(webr.xml)中-->
webr/sales/order/view.phtml
`在这里输入代码`
webr/sales/order/print.phtml
我已经将模板放在了正确的文件夹中,但没有任何效果您可以使用以下代码 在布局中添加xml文件 将其添加到magento
root\app\design\frontend\base\default\layour company.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="header">
<block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">
<block type="checkout/cart_sidebar" name="minicart_content" template="checkout/cart/minicart/items.phtml">
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>yourcompany/checkout/cart/minicart/default.phtml</template></action>
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer_configurable</block><template>yourcompany/checkout/cart/minicart/default.phtml</template></action>
</block>
</block>
</reference>
</default>
</layout>
你是说页眉中最上面的迷你购物车?是的,你也可以称它为ajaxcart(仅在magento 1.9中支持)(1)除非这只是一个输入错误,否则此XML无效:
在此处输入代码
?(2) 这些看起来不像是需要更新模板的块。(3) 您可能需要在标题的
句柄中进行更新,而不是
和
。对不起,我的意思是我遵循了这些内容,现在解决了
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="header">
<block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">
<block type="checkout/cart_sidebar" name="minicart_content" template="checkout/cart/minicart/items.phtml">
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>yourcompany/checkout/cart/minicart/default.phtml</template></action>
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer_configurable</block><template>yourcompany/checkout/cart/minicart/default.phtml</template></action>
</block>
</block>
</reference>
</default>
</layout>
//Write your magic code here