无法设置magento扩展的默认配置

无法设置magento扩展的默认配置,magento,Magento,我们正在运行Magento 1.7.0,并尝试对此进行扩展。该扩展需要一些配置,我们正在etc/config.xml中配置它们。 问题是我们无法为这些配置设置默认值 我们的字段定义: <config> <sections> <mymodule_options translate="label" module="mymodule_core"> <label>Mymodule Core Options</label>

我们正在运行Magento 1.7.0,并尝试对此进行扩展。该扩展需要一些配置,我们正在etc/config.xml中配置它们。 问题是我们无法为这些配置设置默认值 我们的字段定义:

<config>
  <sections>
    <mymodule_options translate="label" module="mymodule_core">
      <label>Mymodule Core Options</label>
      <tab>mymodule_config</tab>
      <frontend_type>text</frontend_type>
      <sort_order>1000</sort_order>
      <show_in_default>1</show_in_default>
      <show_in_website>1</show_in_website>
      <show_in_store>1</show_in_store>
      <groups>
        <api translate="label">
          <label>Advanced Options</label>
          <frontend_type>text</frontend_type>
          <sort_order>1</sort_order>
          <show_in_default>1</show_in_default>
          <show_in_website>1</show_in_website>
          <show_in_store>1</show_in_store>
          <expanded>1</expanded>
          <fields>
            <api_key>
              <label>API Key</label>
              <frontend_type>text</frontend_type>
              <sort_order>1</sort_order>
              <show_in_default>1</show_in_default>
              <show_in_website>1</show_in_website>
              <show_in_store>1</show_in_store>
            </api_key>
            <server_host>
              <label>Server Host</label>
              <frontend_type>text</frontend_type>
              <sort_order>2</sort_order>
              <show_in_default>1</show_in_default>
              <show_in_website>1</show_in_website>
              <show_in_store>1</show_in_store>
            </server_host>
            <server_port>
              <label>Server Port</label>
              <frontend_type>text</frontend_type>
              <sort_order>3</sort_order>
              <show_in_default>1</show_in_default>
              <show_in_website>1</show_in_website>
              <show_in_store>1</show_in_store>
          </server_port>
        </fields>
        </api>
      </groups>
    </mymodule_options>
  </sections>
  <default>
    <mymodule_options>
      <api>
        <server_host>mymodule.herokuapp.com</server_host>
        <server_port>80</server_port>
      </api>
    </mymodule_options>
  </default>              
</config>

Mymodule核心选项
mymodule_配置
文本
1000
1.
1.
1.
高级选项
文本
1.
1.
1.
1.
1.
API密钥
文本
1.
1.
1.
1.
服务器主机
文本
2.
1.
1.
1.
服务器端口
文本
3.
1.
1.
1.
mymodule.herokuapp.com
80
然后我们从核心配置数据中删除相关行,然后错误记录这些值:
Mage::getStoreConfig('mymodule\u options/api/server\u host')

但我们得到的是一个空值。如果我们在管理配置界面中将该值设置为随机值,那么不管怎样,我们都会得到该值。我们做错了什么,默认值声明不起作用

正如R.S在评论中所说,您的
应该放在system.xml中,而
应该放在config.xml中。

上面的代码是在system.xml还是config.xml中?到目前为止,我看到的所有示例都是config.xml中的
。。如