Magento 后端未显示新标签
New tab not showing on Magento backend
我已经在 app/code/local/[Namespace]/[Module]/etc 目录下创建了我的 system.xml,但它似乎不起作用。
我知道给选项卡的同名必须是我在该部分的选项卡标签中放置的名称,而且我的 config.xml 文件中也已经有我的 acl 配置。
有人可以帮我解决这个问题吗?
<config>
<tabs>
<minimum translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</minimum>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>minimum</tab>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<shown_in_default>1</shown_in_default>
<shown_in_website>1</shown_in_website>
<shown_in_store>1</shown_in_store>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>00</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>01</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>02</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
这是我的config.xml
<config>
<modules>
<Ari_Minimum>
<version>0.1.0</version>
</Ari_Minimum>
</modules>
<global>
<models>
<minimum>
<class>Ari_Minimum_Model</class>
</minimum>
</models>
<helpers>
<minimum>
<class>Ari_Minimum_Helper</class>
</minimum>
</helpers>
</global>
<default>
<ari>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</ari>
</default>
<frontend>
<events>
<sales_quote_save_after>
<observers>
<ari_minimum_verifyminimum>
<type>singleton</type>
<class>Ari_Minimum_Model_Observer</class>
<method>verifyMinimum</method>
</ari_minimum_verifyminimum>
</observers>
</sales_quote_save_after>
</events>
</frontend>
<?xml version="1.0" encoding="UTF-8"?>
<config>
<tabs>
<ari translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</ari>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>ari</tab>
<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>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
然后在模块的 etc/ 文件夹中创建一个名为 adminhtml.xml 的文件
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<minimum translate="title" module="minimum">
<title>Ari Minimum</title>
<sort_order>999</sort_order>
</minimum>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
注销并重新登录,删除缓存并尝试,您写的是 shown_in_* 而不是 show_in_*
此外,在配置 .xml 上,改用它
<default>
<minimum>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</minimum>
</default>
希望对您有所帮助
我已经在 app/code/local/[Namespace]/[Module]/etc 目录下创建了我的 system.xml,但它似乎不起作用。
我知道给选项卡的同名必须是我在该部分的选项卡标签中放置的名称,而且我的 config.xml 文件中也已经有我的 acl 配置。
有人可以帮我解决这个问题吗?
<config>
<tabs>
<minimum translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</minimum>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>minimum</tab>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<shown_in_default>1</shown_in_default>
<shown_in_website>1</shown_in_website>
<shown_in_store>1</shown_in_store>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>00</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>01</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>02</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
这是我的config.xml
<config>
<modules>
<Ari_Minimum>
<version>0.1.0</version>
</Ari_Minimum>
</modules>
<global>
<models>
<minimum>
<class>Ari_Minimum_Model</class>
</minimum>
</models>
<helpers>
<minimum>
<class>Ari_Minimum_Helper</class>
</minimum>
</helpers>
</global>
<default>
<ari>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</ari>
</default>
<frontend>
<events>
<sales_quote_save_after>
<observers>
<ari_minimum_verifyminimum>
<type>singleton</type>
<class>Ari_Minimum_Model_Observer</class>
<method>verifyMinimum</method>
</ari_minimum_verifyminimum>
</observers>
</sales_quote_save_after>
</events>
</frontend>
<?xml version="1.0" encoding="UTF-8"?>
<config>
<tabs>
<ari translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</ari>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>ari</tab>
<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>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
然后在模块的 etc/ 文件夹中创建一个名为 adminhtml.xml 的文件
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<minimum translate="title" module="minimum">
<title>Ari Minimum</title>
<sort_order>999</sort_order>
</minimum>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
注销并重新登录,删除缓存并尝试,您写的是 shown_in_* 而不是 show_in_*
此外,在配置 .xml 上,改用它
<default>
<minimum>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</minimum>
</default>
希望对您有所帮助