簡體   English   中英

如何執行自定義模塊啟用/禁用無法在管理員中工作-Magento

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM