Magento Core: (FIX) Admin categories tree for products does not auto-expand to show product categori

Send Snippet To: Save this snippet to Code Collector Pro -- view all tamburra's snippets
language: Other
license: Other

Code for Snippet:

Change the last function to:
    public function getSelectedCategoriesPathIds($rootId = false)
        $ids = array();
        $collection = Mage::getModel('catalog/category')->getCollection()
            ->addFieldToFilter('entity_id', array('in'=>$this->getCategoryIds()));
        foreach ($collection as $item) {
            if ($rootId && !in_array($rootId, $item->getPathIds())) {
            foreach ($item->getPathIds() as $id) {
                if (!in_array($id, $ids)) {
                    $ids[] = $id;
        return $ids;
comments powered by Disqus


Tags: Fix Core CE 1.6

Link to this snippet:

Download to Code Collector

To use the direct link to your snippet on either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 2920
Date Added: 2012-01-22 23:49:22
Last Modified: 0000-00-00 00:00:00

Web Analytics