最初,我是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
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句