Adrian
Adrian

Reputation: 523

opencart 2.3 same image for sub categories

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

Answers (1)

Adrian
Adrian

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

Related Questions