How to get all categories on opencart admin/catalog/product_form.tpl? <p>I'm using opencart 1.5.6 and what I'm trying to do is add a simple select with all the categories and children categories as option on product_form.tpl.</p> <p>I tried add to the follow code at admin/controler/catalog/product.php:</p> <pre><code> $this-&gt;load-&gt;model('catalog/category'); $results = $this-&gt;model_catalog_category-&gt;getCategories(0); foreach ($results as $result) { $this-&gt;data['categories'][] = array( 'category_id' =&gt; $result['category_id'], 'name' =&gt; $result['name'] ); } </code></pre> <p>and for the view admin/view/catalog/product_form.tpl:</p> <pre><code>&lt;tr&gt; &lt;td&gt;Categories&lt;/td&gt; &lt;td&gt;&lt;select&gt; &lt;option value=""&gt;All Categories&lt;/option&gt; &lt;?php foreach ($categories as $category) { ?&gt; &lt;option value="&lt;?php echo $category['name']; ?&gt;"&gt;&lt;?php echo $category['name']; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>but it's not working. It returns nothing.</p> <p>I wish someone could help me and tell me what I'm missing.</p>