我尝试重写sales_order_view这是我在config.xml中的内容
        <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_view>Bitstream_FancourierSelfawb_Block_View</sales_order_view>
            </rewrite>
        </adminhtml>
        <bitstream_selfawb>
            <class>Bitstream_FancourierSelfawb_Block</class>
        </bitstream_selfawb>
    </blocks>
Ofcorse,我在Bitstream/FancourierSelfawb/Block中有适当的文件
我只需要添加一个按钮,但查看其他模块,我看到该块已被覆盖.
        <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_view>Fooman_EmailAttachments_Block_View</sales_order_view>
            </rewrite>
        </adminhtml>
    </blocks>
如果我在Fooman模块的config.xml中对此进行评论,我可以看到我的按钮.否则,没有运气.有没有办法在不同的模块中两次覆盖相同的块?
在app/etc/modules/Bitstream_FancourierSelfawb.xml添加一个depends节点.
<config>
    <modules>
        <Bitstream_FancourierSelfawb>
            ...
            <depends>
                <Fooman_EmailAttachments />
            </depends>
        </Bitstream_FancourierSelfawb>
    </modules>
</config>
当然,你的Bitstream_FancourierSelfawb_Block_View课程必须Fooman_EmailAttachments_Block_View直接延伸而不是Mage原版.
如果您希望添加和使用Fooman扩展都可以使用,那么您将不得不采用更长的基于事件的方法.
| 归档时间: | 
 | 
| 查看次数: | 2960 次 | 
| 最近记录: |