Tomas Jancik Posted January 14, 2011 Share Posted January 14, 2011 HiI'm working on my own module, but it required another module to be installed before, before my mod can work properly...can you please advise me how to check if the required module is installed from the install() method? Link to comment Share on other sites More sharing options...
Yann - Prestaplugins Posted January 14, 2011 Share Posted January 14, 2011 Not so hard to find, just search in Module class and you will find this :if (Module::isInstalled('XXX')) 2 Link to comment Share on other sites More sharing options...
El Patron Posted May 31, 2012 Share Posted May 31, 2012 Not so hard to find, just search in Module class and you will find this : if (Module::isInstalled('XXX')) Here is example code I use during module installation: if (Module::isInstalled(modulenamelowercase)) { Module::disableByName($this->name); //note during testing if this is not done, your module will show as installed in modules die(Tools::displayError('You must first un-install Module xxxx')); } Link to comment Share on other sites More sharing options...
spm.presto Posted July 12, 2013 Share Posted July 12, 2013 Hi Thank you It really works Tested for PrestaShop 1.5.4.1 Regards Link to comment Share on other sites More sharing options...
spm.presto Posted July 12, 2013 Share Posted July 12, 2013 Also it works for PrestaShop 1.4.9.0 Link to comment Share on other sites More sharing options...
joseantgv Posted November 20, 2013 Share Posted November 20, 2013 (edited) I came across this thread trying to find the way to check if a module is enabled, not installed, so I leave here the info just in case someone else need it: Module::isEnabled('modulename') This function is available from Ps 1.5.0.13 onwards. For prior versions you can only check if module is installed with Module::isInstalled('modulename') Edited January 20, 2016 by joseantgv (see edit history) 4 Link to comment Share on other sites More sharing options...
antoniocici Posted January 8, 2014 Share Posted January 8, 2014 I came across this thread trying to find the way to check if a module is enabled, not installed, so I leave here the info just in case someone else need it: Module::isEnabled('modulename') Thank you very much joseantgv, it works great for me Link to comment Share on other sites More sharing options...
rramos-acuabit Posted June 18, 2014 Share Posted June 18, 2014 I came across this thread trying to find the way to check if a module is enabled, not installed, so I leave here the info just in case someone else need it: Module::isEnabled('modulename') Work fine.... thanks very much ;-) Link to comment Share on other sites More sharing options...
Denver Prophit Jr. Posted May 1, 2015 Share Posted May 1, 2015 I'm making responsive product tabs. I'd like to display this tab if crossselling is enabled. What would be the code? {if Module::isEnabled('crossselling')}...{/if} Link to comment Share on other sites More sharing options...
joseantgv Posted May 1, 2015 Share Posted May 1, 2015 I'm making responsive product tabs. I'd like to display this tab if crossselling is enabled. What would be the code? {if Module::isEnabled('crossselling')}...{/if} Is it Smarty code or just a typo? If it is, why don't you check if module is enabled at hook function? Link to comment Share on other sites More sharing options...
Denver Prophit Jr. Posted May 1, 2015 Share Posted May 1, 2015 Is it Smarty code or just a typo? If it is, why don't you check if module is enabled at hook function? It's smarty for product.tpl using bootstrap nav tabs. I'm still learning. I tried to find documentation before posting to the forum. Link to comment Share on other sites More sharing options...
joseantgv Posted May 2, 2015 Share Posted May 2, 2015 It's smarty for product.tpl using bootstrap nav tabs. I'm still learning. I tried to find documentation before posting to the forum. I would check if module is installed in PHP code and send it as a variable to smarty. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now