Skip to content

Instantly share code, notes, and snippets.

@t10u
Created July 10, 2011 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t10u/1074482 to your computer and use it in GitHub Desktop.
Save t10u/1074482 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<config>
<!-- ... -->
<global>
<models>
<foobar>
<class>Foo_Bar_Model</class>
</foobar>
</models>
</global>
<!-- ... -->
<adminhtml>
<events>
<controller_action_postdispatch_adminhtml_catalog_product_save>
<observers>
<foobar>
<class>foobar/observer</class>
<method>clearBlockCache</method>
</foobar>
</observers>
</controller_action_postdispatch_adminhtml_catalog_product_save>
</events>
</adminhtml>
<!-- ... -->
</config>
@t10u
Copy link
Author

t10u commented Jul 10, 2011

class Foo_Bar_Model_Observer
{
    /**
     * Remove the annoying notification on product save.
     *
     * @param type $observer 
     */
    public function clearBlockCache($observer)
    {
        Mage::app()->getCacheInstance()->cleanType('block_html');

        return $this;
    }
}

@twinge
Copy link

twinge commented Feb 14, 2012

what directory does the php file go in?

@jagcbe
Copy link

jagcbe commented Feb 15, 2012

could please tell the exact file location of config.xml
because there too many files in the same name,...
thanks in advance
my site : www.fashion2home.in

@banifou
Copy link

banifou commented Mar 1, 2012

Dear Grigoriu,
could u please be more specific! Where should the php file goes in and which config.xml file should be modified?

Thanks

@sprankhub
Copy link

By the way, I put your code in a ready-to-use Magento extension two years ago: https://github.com/sprankhub/Spranks_RefreshBlockHtmlCache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment