I added fancybox 3 popup feature for admin product list images.It's working ok, but now I can not handle with proper resizing of the images when popup, because they become blurry.
By default, admin product list image width/height are 40/40 and in opencart 2.3 there is now popup feature for admin images.
I made my fancybox size to 400/400, but the images do not resize properly, they are blurry.
Can someone guide me, is there way, to make resizing of the images properly?
Attachments
Capture2.JPG (34.23 KiB) Viewed 957 times
Capture.JPG (56.08 KiB) Viewed 957 times
Last edited by Passko on Sun Apr 30, 2017 2:38 am, edited 1 time in total.
this is, how admin product_list images are titled, meaning, that you would have to
REPLACE that 40x40 Value , by Code, with another Value, matching your image-settings,
to list the image in another Format in a proper visual impression.
Good Luck, I cannot help, when it comes to Regex-Stuff..
But just make sure, that such a routine WILL NOT create an entire range, (like my VqMod could do...!)
of new Cached Product Images, in their special size, and used only,
to please an admin set format.
Ernie
PS: But you could check here, how such is been done in another Mod, doing similar
image-display things. It displays the product order image on demand only, and so saves
overall loading time as well!

REPLACE that 40x40 Value , by Code, with another Value, matching your image-settings,
to list the image in another Format in a proper visual impression.
Code: Select all
/image/cache/data/bigmax_testpage-40x40.jpg
/image/cache/data/demo/sku_312231_2-40x40.jpg

But just make sure, that such a routine WILL NOT create an entire range, (like my VqMod could do...!)
of new Cached Product Images, in their special size, and used only,
to please an admin set format.

Ernie
PS: But you could check here, how such is been done in another Mod, doing similar
image-display things. It displays the product order image on demand only, and so saves
overall loading time as well!

Code: Select all
<modification>
<id>Popup Image in Admin Order</id>
<version>1.5.3.x</version>
<vqmver>1.1.0</vqmver>
<author>Istvan Dobrentei, http://www.dobrenteiistvan.hu</author>
<file name='admin/controller/sale/order.php'>
<operation>
<search position='before'><![CDATA[$this->data['products'][] = array(]]></search>
<add><![CDATA[
$this->document->addScript('view/javascript/image_admin_order.js');
$this->load->model('tool/image');
$productInfo = $this->model_catalog_product->getProduct($product['product_id']);
if ($productInfo['image'] && file_exists(DIR_IMAGE . $productInfo['image']))
{
$productImage = $this->model_tool_image->resize($productInfo['image'], 140, 140);
}
else
{
$productImage = $this->model_tool_image->resize('no_image.jpg', 140, 140);
}
]]></add>
</operation>
<operation>
<search position='before' index='1'><![CDATA[foreach ($products as $product) {]]></search>
<add><![CDATA[
$this->load->model('catalog/product');
]]></add>
</operation>
<operation>
<search position='after'><![CDATA[$this->data['products'][] = array(]]></search>
<add><![CDATA[
'image' => $productImage,
]]></add>
</operation>
</file>
<file name='admin/view/template/sale/order_info.tpl'>
<operation>
<search position='after'><![CDATA[<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>]]></search>
<add><![CDATA[
<div class="product_image" id="product_image_<?php echo $product['product_id'];?>" style="display:none;position:absolute;">
<img src="<?php echo $product['image'];?>" />
</div>
]]></add>
</operation>
</file>
</modification>
I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
2'880 FREE OC Extensions, on the World's largest Github OC Repository Archive Site.
After all, I handled it by myself.
Here is editted mod, now image resizing is properly and we have a nice fancybox for admin product list images.
Tested in OC 2.3.0.2
Here is editted mod, now image resizing is properly and we have a nice fancybox for admin product list images.
Tested in OC 2.3.0.2
Who is online
Users browsing this forum: No registered users and 45 guests