Skip to content

Instantly share code, notes, and snippets.

@Demoli
Created August 8, 2012 11:47
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 Demoli/3294458 to your computer and use it in GitHub Desktop.
Save Demoli/3294458 to your computer and use it in GitHub Desktop.
Mage::getModel('catalog/category')->addFieldToSelect('*')->load($categoryId);
@Judder
Copy link

Judder commented Aug 8, 2012

For selecting Categories based on Varien_Data_Tree_Node::getId() you need to do some extra manipulation

        $category_node_id = $child->getId();
        $category_node_identifier = 'category-node-';
        $category_id = substr($category_node_id, strpos($category_node_id, $category_node_identifier) + strlen($category_node_identifier));
        $category = Mage::getModel('catalog/category')
                   ->load($category_id);

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