I want to modify 3rd party extension and want to override its functionality with the new extension. But my main concern is what if 3rd party extension is not enabled or present in my Magento folder? I want to set dependancy using ifconfig in system.xml or config.xml but I am not sure at extension level that how to check if extension is present in folder. TIA.

EDIT : Thanks to @Sander Mangel for dependency answer. Now let me be more clear.

I can easily set dependency using app/etc/modules/MyNameSpace_MyModule.xml but when my 3rd party extension is removed from system, error report is generated and its showing "Module "MyNameSpace_MyModule" requires module "3rdPartyExtension" and stopped further execution cause it has generated exception but what if I want to execute further without generating exception? Simply MyExtension will not take effect if 3rdpartyextension is not present without stopping magento to execute. So that's why I am asking is there any kind of facility like we did on layout files to check. NOTE ifconfig here.

<reference name="sales.order.print">
        <action method="setTemplate" ifconfig="3rdparty/config">

Second Edit : Thanks to Zyava. I did what I want but say If I deleted my 3rd party extension for trial purpose to see what happens.. I created my system.xml as below

                <3rdparty extension translate="label" module="payment">
                    <label>3rd Party</label>
                        <disallowedcustomergroups translate="label comment">
                            <label>Disallowed Customer Groups</label>
                            <comment><![CDATA[Press control and select multiple groups]]></comment>

So you can see that I have simply specified one tab based on activation of 3rd party extension. But I have deleted 3rd party extension fully from my system but still its showing other options of 3rd party extensions? Why its showing them though I have cleared my cache?

2 Answers 2


As far as I understand what you need, you should use <depends tag, example from app/code/core/Mage/Paypal/etc/system.xml:

<payment_action translate="label">
    <label>Payment Action</label>

<authorization_honor_period translate="label comment">
    <label>Authorization Honor Period (days)</label>
    <comment>Specifies what the Authorization Honor Period is on the merchant’s PayPal account. It must mirror the setting in PayPal.</comment>
    <depends><payment_action>Order</payment_action></depends> <!-- see this line -->
  • Thank you so much... I can find that in core xml but don't know exactly what it does. Apr 12, 2013 at 10:02
  • Please refer my second edit... Apr 12, 2013 at 10:07
  • If in payment_action field you select Order, field authorization_honor_period becomes visible. Apr 12, 2013 at 17:21

Dependencies can be set in your app/etc/modules XML. Magento will check if the extension is available.

<?xml version="1.0"?>

Or use the following code to check if an extension is enabled. This can be done by creating a helper method in Namespace/Module/Helper/Data.php

class Namespace_Module_Helper_Data extends Mage_Core_Helper_Abstract 

   public function extensionEnabled()
      return Mage::getStoreConfig('advanced/modules_disable_output/Namespace_Module');
  • Thanks for your answer.. What if I have to check extension is enabled or not? Apr 12, 2013 at 7:51
  • Hey Kamal, you could use Mage::getStoreConfig('advanced/modules_disable_output/Namespace_Module');. I've added the code in my awnser Apr 12, 2013 at 7:53
  • yeah that's true but what if I wish to check in system.xml like normally we can check in layout.xml of theme using ifconfig? Apr 12, 2013 at 7:56
  • So only adding your config fields if the 3th party tab in system > configuration is present? Apr 12, 2013 at 7:58
  • No actaully want to provide further options based on selection.. Apr 12, 2013 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.