Display categories' thumbs

Hello, i have a problem using a custom code into skins/basic/customer/views/categories/view.tpl :


<br />
<td align="center" valign="middle" width="{$cell_width}%"><br />
  <a href="{"categories.view?category_id=`$category.category_id`"|fn_url}">{include file="common_templates/image.tpl" show_detailed_link=false object_type="category" images=$category.main_pair no_ids=true class="cm-thumbnails" show_thumbnail="Y" image_width=$settings.Thumbnails.category_lists_thumbnail_width image_height=$settings.Thumbnails.category_lists_thumbnail_height}</a><br />
</td><br />

```<br />
<br />
the displayed image is the no_image.gif and not the category's image!<br />
<br />
It seems like [b]$category.main_pair[/b] is empty!

You have to set up a controller too. There is an addon for this already here on the forum that I even upgraded to 3.0.1.



You can also follow the instructions in the knowledge base. You'll need t tweak the code a bit for your own individual needs, but it should get you started.



Thanks,



Brandon

Nothing of those really works. Forum is full of reports that addons not working or working accidentally after X hours… or something.





the controller yes! I just forgot this!



So, I know that is wrong but works for me fine.



In controllers/customer/categories.php

FIND



fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => true, 'get_features' => false));




And PASTE AFTER that:



//START - Added by me :P
$subcat = $view->get_var('subcategories');
$subcat = fn_get_subcategories($_REQUEST['category_id']);
foreach($subcat as $k => $v) {
$subcat[$k]['main_pair'] = fn_get_image_pairs($v['category_id'], 'category', 'M', true, true);
}
$view->assign('subcategories', $subcat);
//END