Post by mouseflo5 » Sat Nov 07, 2015 9:15 pm

Hello all!

I think the problem with images on Opencart is something what everyone faces. I mention the Opencart function that takes product image and fit it to the size configured as Product Image Popup Size. And as result there are can be ugly white borders around product image in popup. Or you have to make ALL your images same size or dimension.

I would to ask is there anyone who had resolved this problem for OC 2.x ? If yes please could you share a code we need to change to open original images in pop-up for products on Product Page instead fitted?

---------------------------------
For OC 1.5 I had used this solution but it doesn't work anymore :-[

Code: Select all

IN /catalog/controller/product/product.php
Look for:
$this->data['popup'] = $this->model_tool_image->resize($image, $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
Change to:
CODE: SELECT ALL
$this->data['popup'] = 'image/' . $product_info['image'];

& within the same file....

Look for:
'popup' => $this->model_tool_image->resize($result['image'] , $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
Change to:
'popup' => 'image/' . $result['image'],

Newbie

Posts

Joined
Sat Nov 07, 2015 9:01 pm

Post by uksitebuilder » Sun Nov 08, 2015 7:11 pm

change $this->data to $data

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mouseflo5 » Mon Nov 09, 2015 1:17 am

uksitebuilder, thanks for answer. I had read this your recommendation in another post and tried already this recommendation but it doesn't work. What I have changed exactly in /catalog/controller/product/product.php:

Code: Select all

$data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
CHANGED TO

Code: Select all

$data['popup'] = 'image/' . $product_info['image'];

Code: Select all

'popup' => $this->model_tool_image->resize($result['image'] , $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
CHANGED TO:

Code: Select all

'popup' => 'image/' . $result['image'],
Absolutely no effect :-\

Newbie

Posts

Joined
Sat Nov 07, 2015 9:01 pm

Post by uksitebuilder » Mon Nov 09, 2015 4:04 pm

Tested and working for me.

Maybe you have an old version of the file cached somewhere.

Try refreshing your modifications in Extensions - Modifications

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mouseflo5 » Mon Nov 09, 2015 6:21 pm

uksitebuilder, thanks you!! after refreshing modification it works! :)

Newbie

Posts

Joined
Sat Nov 07, 2015 9:01 pm

Post by Fireballcz » Fri Jun 14, 2019 2:44 am

Tested on 3.0.2.0, works OK
Problems, needed to solve:
1) do not uses cache, thats why
2) unable to aply on-the-fly watermark functionality (if needed, watermarked product imagest must be uploaded)
Any solution of this?
Thanks in advance

Newbie

Posts

Joined
Mon Mar 26, 2018 2:04 am
Who is online

Users browsing this forum: masterross and 8 guests