0

I have an extension which needs to be on for some sites and off for others, however it is creating a page on all the sites even when disabled.

Is there a way for an extension to check if it is enabled for output for a specific store id?

I'm using:

 $enabled =  Mage::helper('core')->isModuleEnabled('Module_Name');

But this returns 1 if echoed out, as the module is enabled in general, therefore the hook is still making a page even if the output is disabled.

Updated code based on answer - but still rendering to the blank page:

    if(Mage::getStoreConfig('advanced/modules_disable_output/module_name',$store_id) == 35)
    {
        $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
        $this->getResponse()->setHeader('Status','404 File not found');
        $this->_forward('defaultNoRoute');
    }else{
        $this->loadLayout();
        $this->renderLayout();
    }
1
public function canShowTab()
{
    return Mage::helper('Core')->isModuleEnabled('Vendor_Module');
}

OR

if(Mage::getStoreConfig('advanced/modules_disable_output/module_name',$store_id) == 1)
{
    return false
}else{
   return true;
}
  • Hi, this is showing enabled because the extension is enabled in general - I need this on a store level. – Aravona Nov 23 '16 at 9:54
  • @Aravona, Check my updated answer – Ashish Jagnani Nov 23 '16 at 10:14
  • hi this does absolutely nothing and still causes the page to render blank. – Aravona Nov 23 '16 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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