In file /catalog/controller/product/category.php change lines 184 to 189
from
Code: Select all
$product_total = $this->model_catalog_product->getTotalProducts($data);
$this->data['categories'][] = array(
'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
Code: Select all
$product_total = $this->model_catalog_product->getTotalProducts($data);
$category_info = $this->model_catalog_category->getCategory($result['category_id']);
$this->data['categories'][] = array(
'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
'image' => $category_info['image'],
);
catalog/view/theme/default/template/product/category.tpl you could use the variable
$categories[$i]['image']
(or)
$category['image']
to show the category image.
If a category does not have an image you will receive errors !
Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com
Who is online
Users browsing this forum: Google [Bot] and 162 guests