Post by Passko » Sat Apr 29, 2017 2:05 pm

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

Capture2.JPG (34.23 KiB) Viewed 883 times

Capture.JPG

Capture.JPG (56.08 KiB) Viewed 883 times

Last edited by Passko on Sun Apr 30, 2017 2:38 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jan 15, 2015 7:47 pm

Post by IP_CAM » Sun Apr 30, 2017 1:57 am

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.

Code: Select all

/image/cache/data/bigmax_testpage-40x40.jpg
/image/cache/data/demo/sku_312231_2-40x40.jpg
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! ;)

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>		
Image

Attachments

popup_admin_image.png

popup_admin_image.png (82.24 KiB) Viewed 829 times


I don't use the Forum Mailer, to reach me, contact: jti@jacob.ch
-
Demoversions:
OpenCart LIGHT v.1.5.6.5 http://www.bigmax.ch/
OpenCart V-PRO v.1.5.6.5 http://www.ebikes.li/shop/
-
1'700+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Passko » Sun Apr 30, 2017 2:27 am

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

Attachments


Newbie

Posts

Joined
Thu Jan 15, 2015 7:47 pm
Who is online

Users browsing this forum: No registered users and 10 guests