Search code examples
phpmagentomoduleobserversadminhtml

How to obtain category id in a custom category edit tab?


Magento 1.8:

I have added a tab in catalog->category edit page through observers. (core_block_abstract_prepare_layout_after)

Everything works correctly, but not how to get category_id in the function of the observer, for use in the logic of custom tab.

Any idea?


Solution

  • You probably can check for keys in registry. If you're in the backoffice on a category edit page, you have these keys registered:

    Mage::register('category', $category);
    Mage::register('current_category', $category);
    

    Cheers