OK,开拓/catalog/controller/common/header.php
查找这个代码
// Level 1
$this->data['categories'][] = array(
'name' => $category['name'],
'children' => $children_data,
'column' => $category['column'] ? $category['column'] : 1,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
改变它
// Level 1
$this->load->model('tool/image');
$image = empty($category['image']) ? 'no_image.jpg' : $category['image'];
$thumb = $this->model_tool_image->resize($image, 100, 100);
$this->data['categories'][] = array(
'name' => $category['name'],
'children' => $children_data,
'column' => $category['column'] ? $category['column'] : 1,
'thumb' => $thumb,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
然后在/catalog/view/theme/[your-theme-name]/template/common/header.tpl
只需使用$category['thumb']
无论你需要它
注意,我已经设定了宽度和heig在上面的代码ht到100px,你应该适当地改变它
我试图解释我的最好,但没有完全得到它。我想要的是要在菜单中显示的类别图像以及类别名称。我只想要父类别图像,而不是子类。那还好吗? – user1122925 2011-12-30 15:21:54
看看上面的那个,应该回答你需要的东西 – 2011-12-30 17:12:52
你绝对的传奇!谢谢。 – user1122925 2012-01-04 15:23:06