How to verified Magento module is installed or not?

I Am working away at a Magento module which works in the relationship of Magento Call for Price and Magento Partial Payment modules. So before executing the code of building up the module I needed to watch that Magento Call for Price and Magento Partial Payment modules were introduced or not.

To discover a code to check whether any Magento module is introduced or not, I found many ways but rather here I will talk about the one which I had utilized.

1
2
3
4
5
6
7
8
9
10
11
$modules = (array)Mage::getConfig()->getNode('modules')->children();
if (isset($modules['Indies_Callforprice'])) {
    echo 'Module is installed.';
    if ($modules['Indies_Callforprice']->is('active')) {
        echo 'Module is active.';
    } else {
        echo 'Module is not active.';
    }
} else {
    echo 'Module is not installed.';
}

The above code will watch that the predetermined module has been introduced or not and it is dynamic or not. In the code above I have checked whether the Indies_Callforprice module is introduced and dynamic or not. Presently to utilize this code you simply need to change the name of module, so rather than Indies_Callforprice you have to compose your own module name

READ  Login with Twitter using PHP