Reputation: 523
I am using opencart 2.3 and in category page, all sub categories have same image. Title is different, in backend and database images are different.
Removed everything from /image/cache
with no effect.
Tried to add $image
into $data['categories']
array, in controller/product/category.php
but is the same.
This is my code from <theme>/product/category.tpl
<?php if ($categories) { ?>
<?php foreach ($categories as $category) { ?>
<a href="<?php echo $category['href']; ?>"><img src="<?php echo $thumb; ?>" alt="<?php echo $category['name']; ?>" /><p><?php echo $category['name']; ?></p></a>
<?php } ?>
<?php } ?>
Can't find nothing else to fix this. Will be very appreciate, if you can help.
Upvotes: 2
Views: 99
Reputation: 523
Fixed by adding this:
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_category_width'), $this->config->get($this->config->get('config_theme') . '_image_category_height'))
to $data['categories']
array.
:)
Upvotes: 1