[英]How to do the custom module enable/disable not working in admin - Magento
最初,我是magento的新手。 因此,请帮助我学习magento。 我创建了一个名为“卡券”的自定义模块。 我需要启用或禁用模块表单adminpanel。 所以我在上创建了system.xml
我的应用程序/代码/社区/卡/凭证/etc/system.xml。 代码如下所示
<config>
<tabs>
<myconf translate="label">
<label>card voucher</label>
<sort_order>150</sort_order>
</myconf>
</tabs>
<sections>
<tab1 translate="label" module="adminhtml">
<label>Enable / Disable</label>
<tab>myconf</tab>
<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>
<groups>
<general translate="label comment">
<label>General</label>
<sort_order>50</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment><![CDATA[This is a <strong>card voucher</strong> Extension used for checking voucher code.<br />You can simply enable disable this extension here. ]]></comment>
<fields>
<active translate="label comment">
<label>Enable/Disable</label>
<frontend_type>select</frontend_type>
<sort_order>54</sort_order>
<source_model>adminhtml/system_config_source_enabledisable</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</active>
</fields>
</general>
</groups>
</tab1>
</sections>
然后,我禁用了该模块,但仍保留在我的网站上。 我认为此代码仅足以建立此功能。
请尽快帮我
谢谢
通常,您将要禁用模块功能,而不是从系统配置中禁用模块本身。
该模块的作用是什么?
在你的代码
if(Mage::getStoreConfig('sectionName/groupName/active')){
// run your code
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.