Magento 1.7-覆盖system.xml [英] Magento 1.7 - Overwrite system.xml

查看:77
本文介绍了Magento 1.7-覆盖system.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想向特定的客户组显示一种付款方式,因此我想在后端付款方式中添加一个配置字段.我试图在自定义模块中覆盖Mage_Payment system.xml:

I want to show a payment method only to specific customer groups, and therefore i want to add a config field in backend payment methods. I tried to overwrite the Mage_Payment system.xml in my custom module:

MyNamespace_OverwriteCfg.xml

MyNamespace_OverwriteCfg.xml

<config>
    <modules>
        <MyNamespace_OverwriteCfg>
            <active>true</active>
            <codePool>local</codePool>
        </MyNamespace_OverwriteCfg>
    </modules>
</config>

system.xml:

system.xml:

<config>
<sections>
    <payment>
        <groups>
            <invoice>
                <fields>
                    <specificgroup translate="label">
                        <label>Payment on specific customer groups</label>
                        <frontend_type>multiselect</frontend_type>
                        <sort_order>51</sort_order>
                        <source_model>adminhtml/system_config_source_customer_group</source_model>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </specificgroup>
                </fields>
            </invoice>
        </groups>
    </payment>
</sections>
</config>

如果我将其添加到支付核心system.xml中,则可以正常工作,但我不会编辑核心文件,但覆盖将无法工作.

If i add this in the payment core system.xml it works fine, but i won't edit core files but overwriting won't work.

推荐答案

解决方案是,我只是在xml节点结构中犯了一个错误. 要向货到付款"添加字段,当然必须是这样的:

The solution was, i simply had a mistake in my xml node structure. To add a field to "cash on delivery" of course it has to be like this:

<config>
   <sections>
        <payment>
            <groups>
                <cashondelivery> <!--Here was the mistake -->
                    <fields>
            //...
                    </fields>
                </cashondelivery> <!--Here was the mistake -->
            </groups>
         </payment>
    </sections>
</config>

这篇关于Magento 1.7-覆盖system.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆