dpv46227 2015-06-04 13:17
浏览 43

如何使用自定义模块覆盖minicart phtml文件

I am trying to override minicart phtml file, used this code in config.xml->

<layout>
    <updates>
        <rakesh_webr module="Webr">
            <file>webr.xml</file>
        </rakesh_webr>
    </updates>
</layout>

and this in my layout config file (webr.xml)->

<layout>
     <sales_order_view>
       <reference name="sales.order.view">
          <action method="setTemplate">
             <template>webr/sales/order/view.phtml</template>
          </action>
       </reference>`enter code here`
    </sales_order_view>
    <sales_order_print>
       <reference name="sales.order.print">
          <action method="setTemplate">
             <template>webr/sales/order/print.phtml</template>
          </action>
       </reference>
   </sales_order_print>
</layout>

and i have put the templates in right folder but nothing is working

  • 写回答

1条回答 默认 最新

  • drxnfdx798517235 2016-09-02 06:01
    关注

    You can use the following code.

    In your layout add the xml file.

    Add this inside the magento root\app\design\frontend\base\default\layout\yourcompany.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>
    

    Then create the file in magento root\app\design\frontend\base\default\template\yourcompany\checkout\cart\minicart\default.phtml

    //Write your magic code here
    
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100