Magento: How to disable update notifications


A short tutorial on how to block the “New Magento Version” notifications in the Magento admin without modifying the core packages.

Create a new package under app/code/local , for this example lets make a “MyCompany” package. If you already have an existing package for your magento mods you can use that one but you will have to change all references to MyCompany in the following code.

Create folder app/code/local/MyCompany

Create a new module called “Adminhtml” containing a “Block” folder and a “etc” folder.

Create folder app/code/local/MyCompany/Adminhtml
Create folder app/code/local/MyCompany/Adminhtml/Block
Create folder app/code/local/MyCompany/Adminhtml/etc

Add a “Notification” folder inside the Block folder.

Create folder app/code/local/MyCompany/Adminhtml/Block/Notification

Create Toolbar.php inside the MyCompany/Block/Notification folder.

<?php
/**
 * Block all notifications
 */
class MyCompany_Adminhtml_Block_Notification_Toolbar extends Mage_Adminhtml_Block_Template
{
    public function isShow()
    {
	return false;
    }

    public function isMessageWindowAvailable()
    {
        return false;
    }
}

Create Window.php inside the MyCompany/Adminhtml/Block/Notification folder.

<?php
/**
 * Prevent popup window
 */
class MyCompany_Adminhtml_Block_Notification_Window extends Mage_Adminhtml_Block_Notification_Window
{
    public function canShow()
    {
        return false;
    }
}

Create config.xml file inside the MyCompany/Adminhtml/etc folder

<?xml version="1.0" encoding="UTF-8"?>

<config>

    <modules>
        <MyCompany_Adminhtml>
            <version>0.1.0</version>
        </MyCompany_Adminhtml>
    </modules>

    <global>

        <blocks>
          <adminhtml>
              <rewrite>
             	  <notification_window>MyCompany_Adminhtml_Block_Notification_Window</notification_window>
		  <notification_toolbar>MyCompany_Adminhtml_Block_Notification_Toolbar</notification_toolbar>
              </rewrite>
          </adminhtml>
        </blocks>

    </global>

</config>

Last but not least, you have to create a new Modules XML file to load your module. Create MyCompany.xml inside the app/etc/modules folder.

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MyCompany_Adminhtml>
	    <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Adminhtml />
            </depends>
        </MyCompany_Adminhtml>
    </modules>
</config>

3 responses to “Magento: How to disable update notifications”

  1. Great tutorial, worked fine for me on Magento 1.3.1.

    It would be nice if you could replace Boutik for MyCompany in the codesnippet for MyCompany.xml, would make find and replace MyCompany easier after pasting.

    Regards,

    Pim Schaaf