Saturday, August 13, 2011

Catalog View as Images on Homepage

Need modify controller to supply image variable.
opencart/catalog/controller/module/category.php
Need to modify view.
opencart/catalog/view/theme/default/template/module/category.tpl

First add the image in the view
img src="/opencart/image/ $category['image']

don't forget the comma.

If you look in the database there is a table called
category with a column called image that has the url.


However, this is the big full size image we need to shrink it.

$this->load->model('tool/image');
this loads the tool
$image = $this->model_tool_image->resize($category['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
this shrinks the image found in database table category column image





No comments:

Post a Comment