Question

Is there any possibility to hide a menu related to a custom module in the admin side when the custom module is deactivated using the system config options written in the system.xml of the magento.

Please anyone help me.

Was it helpful?

Solution

As mentioned in comments to OP question, this is a duplicate of Possible to hide admin menu if custom module is disabled?

but placed as answer to respond to OP's comments.

You will place the <depends> in the menu item configuration, as such:

(code example taken from ecomdev's post mentioned in the noted duplicate answer)

     <menu>
        <mycustom_menu translate="title" module="[module_name]">
            <!-- this depends will hide the entire menu option -->
            <depends>
              <config>payment/checkmo/active</config>
            </depends>
            <title>My Custom Menu Item</title>
            <sort_order>300</sort_order>
            <children>
                <!-- child items go here -->
                <subitem translate="title" module="[module_name]">
                    <!-- this depends will hide the sub menu option -->
                    <depends>
                       <module>payment/checkmo/active</module>
                    </depends>
                    <title>Subitem</title>
                    <sort_order>10</sort_order>
                    <action>adminhtml/mycustom_controller/</action>
                </subitem>
            </children>
        </mycustom_menu>
    </menu>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top