title: Augment category detail with product information
body: <p>I currently have a piece of code that puts together data about all of the categories in Magento.  I would like to add product details, including but not limited to:</p>
  
  <ul>
  <li>price</li>
  <li>sku</li>
  <li>image url</li>
  </ul>
  
  <p>I'm having trouble adding those attributes to the response</p>
  
  <pre><code>&lt;?php
  
  require_once('../app/Mage.php'); //Path to Magento
  umask(0);
  Mage::app();   
  function getCategoryTree($recursionLevel, $storeId = 1)
  {
      $parent = Mage::app()-&gt;getStore()-&gt;getRootCategoryId();    
      $tree = Mage::getResourceModel('catalog/category_tree');
  
      $nodes = $tree-&gt;loadNode($parent)
          -&gt;loadChildren($recursionLevel)
          -&gt;getChildren();
      $tree-&gt;addCollectionData(null, false, $parent);
  
  
      $categoryTreeData = array();
      foreach ($nodes as $node) {
          $categoryTreeData[$node-&gt;getData('entity_id')] = getNodeChildrenData($node);
      }
  
      return $categoryTreeData;
  }
  
  function getNodeChildrenData(Varien_Data_Tree_Node $node)
  {
      $data = array(
          'title' =&gt; $node-&gt;getName(),
          'url'   =&gt; $node-&gt;getData('url_key'),
          'price'   =&gt; $node-&gt;getPrice(),
      );
  
      foreach ($node-&gt;getChildren() as $childNode) {
          if (!array_key_exists('children', $data)) {
              $data['children'] = array();
          }
  
          $data['children'][$childNode-&gt;getData('entity_id')] = getNodeChildrenData($childNode);
      }
      return $data;
  }
  
  print_r(json_encode(getCategoryTree(100)));
  
  ?&gt;
  </code></pre>