Post by gizmecano » Mon May 25, 2015 4:00 pm

Greetings,

I'm currently looking for the proper way to work on a theme using the real image of a product and not its thumbnail (identified as $thumb in the default theme).

I have found a abrupt trick by adding a line in the controller file:

Code: Select all

$this->data['cover'] = $product_info['image'];
But does anybody have experienced a better method (eg with vqmod) to retrieve these real image data without changing controller content?

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by viethemes » Mon May 25, 2015 9:23 pm

Do you want to use the real image in all pages or a module?

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by gizmecano » Tue May 26, 2015 12:38 am

viethemes wrote:Do you want to use the real image in all pages or a module?
In pages, such as product.tpl or category.tpl for example.

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by viethemes » Thu May 28, 2015 10:32 pm

Yes. You can install this OCMOD extension https://www.dropbox.com/s/mitapbk9bksfg ... d.xml?dl=0.
Note that you have to put product image into the product folder.

Attachments

product folder.png

product folder.png (168.78 KiB) Viewed 1857 times


http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by gizmecano » Fri May 29, 2015 1:55 am

Greetings,

Thank you...

But I must admit that I'm a little surprised that it seems so difficult to find a basic way to recover this variable... ???

I will test your process if I don't find a more simple solution (installing another "system" than vqmod, only for retrieve a elementary data, sounds a little "weighty").

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by gizmecano » Fri May 29, 2015 3:35 pm

Greetings,
viethemes wrote:You can install this OCMOD extension [...]
Note that you have to put product image into the product folder.
Inspired by your answer (and in order to eventually retrieve any directory), I've tried to work on a VQMOD alternative (for not twisting directly controllers).

I've found a way to retrieve the complete URL for the main image by adding this line to the file named vq2-catalog_controller_product_product.php:

Code: Select all

$data['picture'] = HTTP_SERVER.'/image/'.$product_info['image'];
Everything seems to work fine (although I'm not actually sure that's the "best" method). :-\

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by viethemes » Fri May 29, 2015 9:03 pm

You should use OCMOD extension or VQMOD extension to modify it. If you modify the file in VQMOD cache, it will be lost when you rebuild modifications in admin > Extensions > Modifications.

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by gizmecano » Fri May 29, 2015 10:00 pm

Greetings,
viethemes wrote:You should use OCMOD extension or VQMOD extension to modify it.
Thank you for the warning. I will check this.

It's peculiar that core files seem not to permit to retrieve these essential data easily.

For example, we can find quickly height and length of a product into compare.tpl, but not display this important data on product.tpl without cheating. Am I alone to find it weird? Or maybe I missed something...

To return into the case of "real images", I'm wondering why only use of thumbnails seem suitable, whereas trend is now to responsive design and/or high resolution pictures (such as "retina")...

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by IP_CAM » Fri May 29, 2015 10:24 pm

>> It's peculiar that core files seem not to permit to retrieve these essential data easily. <<
VqMod-Cached Files are not CORE-Files, they are just the combined TEMP-File result of different Parts of Source, combined thogeter, to make a Page.

Code: Select all

vq2-catalog_controller_product_product.php
would mean, that the source-file, in charge, is this:

Code: Select all

controller/product/product.php
Ernie
bigmax.ch/os/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by gizmecano » Fri May 29, 2015 11:10 pm

Greetings,
IP_CAM wrote:VqMod-Cached Files are not CORE-Files
I have trouble expressing myself: I totally understand that these files are not "core files".

I wonder why "core files" seem to not allow operation as simple as just find the URL of the real image of a product (and that's why I have to use VQMOD or OCMOD for this).

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by IP_CAM » Sat May 30, 2015 1:59 am

It's easy to understand, today's shop Owners have mostly no Idea about, how to 'premake' images, in order to keep a Site running, possibly containing thousands of images, Many upload images greater than 1000++px width, and bigger then 1MB Filesize. No Shop would accept such Newbie-Doings, in a longer term.

Therefore, ALL Images are 'redrawn', and replaced, moved into CACHE Folders, by OC, to make 'em matching PREDEFINED Sizes, and so, shrinking them, in VALUE, as well.

Anything else would not function, in real life, every image would have another size, breaking all visual settings, and looking like Hell. Just because, it's TOO MUCH work involved, for most 'like to be' Shop Owners, Time matter to them most, and most would not even know, how to edit an image... ::)

I hope, you'll understand, it's the only way to make it work. ;)
Ernie
bigmax.ch/os/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by gizmecano » Sun May 31, 2015 11:50 pm

Greetings,
IP_CAM wrote:I hope, you'll understand, it's the only way to make it work.
I totally understand the reasons that you have explained and why OpenCart prefers to function like that, but I can't really approve: small fuzzy squared images aren't actually consistent with the idea that I'm getting a website in 2015...

This explanation seem to be justified concerning images. But it doesn't explain why other data (essential in some cases, such as length, height, etc.) aren't included in some core files.

But regardless of these "philosophical" questions, I needed to find how to retrieve the real picture of a product, and with your help and feedback, I did it using vQmod.

Thank you to all.

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by IP_CAM » Fri Jun 05, 2015 11:39 pm

ok, I assume, you are looking for something like this:
(OC v.1.5.6.5_rc)
http://www.hitline.info/shop/index.php? ... uct_id=651

then, download this, I checked the OC v.2.0.2.x 'image.php', and it looks the same, I have implemented the code directly onto the image.php, in order to avoid another additional Mod, if it has to 'stay' anyway... ;) .

Code: Select all

	// Image auto size valdeirpsr
		if ($width == 'auto'){
			$width = $this->info['width'];
		}

		if ($height == 'auto'){
			$height = $this->info['height'];
		}
	// Image auto size valdeirpsr
		$ypos = 0; 
		$scale = 1; 
So, I expect it to work on your Shop as well:
http://www.opencart.com/index.php?route ... n_id=11429

as an "un-philosophical" reply to this! ;)
Ernie
bigmax.ch/os/

Some well done and reliable Mass - IMAGE TOOLS
can be found here:
http://forum.opencart.com/viewtopic.php ... 31#p508148

PS. I recalled to see this Mod, in the Extension Section, about a week ago. Good for You! :D
But, I am not sure, if your image Uploader will NOT automatically shrink images as well, possibly, therefore,
you are well advised to upload all images directly to the server by FTP, to keep them in SHAPE!

ONE MORE HINT: DELETE ALL OF YOUR IMAGE FILES, placed within the SERVER image/cache Section, frequently, if you make changes on the images size definitions. ONCE created Cached images, i.E., sized 500x500px, would stay forever, and possibly never ever used again. But you may end up like I did, when receiving a Complaint from my Hoster, telling me to remove, at LEAST, 100'000 suprlus files, or pay more RENT!!!

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by gizmecano » Sat Sep 19, 2015 11:30 pm

Greetings,

Thanks for this suggestion. I add it to the possible ways to work with the real image and not only the thumbnail. By the way, I've updated my own method, by adding the possibility to display also a default image.

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm
Who is online

Users browsing this forum: No registered users and 2 guests