Author Topic: getting full images on product pages  (Read 19930 times)

Benis

  • Beginner
  • *
  • Posts: 1
getting full images on product pages
« on: September 25, 2008, 19:30:46 pm »
Hiya, Can anyone help. I'm running Virtuemart 1.1.2 and Joomla 1.0.15
I've tryed a bunch of hacks in this forum to get full images to appear on product pages but none work.
Any ideas?
Cheers Ben

PS the closest i got was with this hack (see below) but then could only get the full image to show (in full) by increasing the size of the thumbnails. Which in turn made all the thumbnail images larger except for the thumbnail of the page i was using to test. Very Strange!



These are the steps that I followed and big images are showing now:

1) Virtuemart configuration: Layout, set "Enable Dynamic Thumbnail Resizing?" OFF

2) File:
/administrator/components/com_virtuemart/classes/ps_product.php
Line: 1301

   Change "$resize=1" to "$resize=0"

3) file:
components/com_virtuemart/themes/default/theme.php
change lines: 85, 91, 97

   Replace:
       $product['product_thumb_image'], $img_attributes, 1
   with:
      $product['product_full_image'], $img_attributes, 0

4) Depending on the selected flypage in Virturemart configuration:

For example, if you have selected "flypage_new", find the file:

components/com_virtuemart/themes/default/product_details/flypage_new.tpl.php

change where the image is loaded:

<?php echo $product_image ?>

replace with:

<?php echo ps_product::image_tag( $product_full_image, 'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ) ?>



bulesz

  • Jr. Member
  • **
  • Posts: 194
Re: getting full images on product pages
« Reply #1 on: February 04, 2009, 16:55:11 pm »
not good solution, because cant enlarge the image...:(

mmtcbrick

  • Beginner
  • *
  • Posts: 3
Re: getting full images on product pages
« Reply #2 on: February 25, 2009, 21:30:32 pm »
I have found a solution that at least works for me. What I did was I made a line similar to the following in the flypage:

Code: [Select]



<img src='components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>' style="width: 200px;" alt=''/>




Of course, before I make this live I will clean it up a bit but this works fine for me.

wai2kas

  • Beginner
  • *
  • Posts: 17
Re: getting full images on product pages
« Reply #3 on: February 25, 2009, 22:14:57 pm »
Yes it works great with image size! But how to return View Full-Size Image ?  :-\

ajaysalanky

  • Beginner
  • *
  • Posts: 16
Re: getting full images on product pages
« Reply #4 on: March 02, 2009, 21:16:29 pm »
works well for me thanks!

wai2kas

  • Beginner
  • *
  • Posts: 17
Re: getting full images on product pages
« Reply #5 on: March 03, 2009, 01:02:44 am »
And You can maximize the image? Can You see "View Full-Size Image" ??

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: getting full images on product pages
« Reply #6 on: March 03, 2009, 02:16:51 am »
I have a solution, It is slightly more complex but does work. But in this you specify the maximum thumbnail size to be displayed on all product detail pages.

2 files need to be edited.

in /components/com_virtuemart/themes/default/theme.php

edit line 85

Code: [Select]
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br/>".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');


to

Code: [Select]
$text = ps_product::image_tag($product['product_full_image'], $img_attributes, 1,null,200,200,true)."<br/>".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');


the 200,200 above is the new max size of the thumbnail to display on the product page, but instead of supplying the thumb nail, the full image is supplied. This only works with dynamic resizing turned on.

edit /administrator/components/com_virtuemart/classes/ps_product.php

line 1347 change from

Code: [Select]
function image_tag($image, $args="", $resize=1, $path_appendix='product', $thumb_width=0, $thumb_height=0 ) {


to

Code: [Select]
function image_tag($image, $args="", $resize=1, $path_appendix='product', $thumb_width=0, $thumb_height=0,$overide=false ) {


line 1364 from

Code: [Select]
if(PSHOP_IMG_RESIZE_ENABLE == '1' || $resize==1) {
$url = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($image)."&amp;newxsize=".PSHOP_IMG_WIDTH."&amp;newysize=".PSHOP_IMG_HEIGHT."&amp;fileout=";

to

Code: [Select]
If($overide) {
$new_img_width = $thumb_width;
$new_img_height = $thumb_height;
}
else
{
$new_img_width = PSHOP_IMG_WIDTH;
$new_img_HEIGHT = PSHOP_IMG_HEIGHT;
}
if(PSHOP_IMG_RESIZE_ENABLE == '1' || $resize==1) {
$url = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($image)."&amp;newxsize=".$new_img_width."&amp;newysize=".$new_img_height."&amp;fileout=";

Basically, if overide is not set to true or not set at all, everything works as normal. When set to true it overides the default image size set in the site tab of the configuration to the size set by thumb sizes set in theme.php alteration above.

It can be seen working here

If you go back to the category you will see the thumb images at their normal size.
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

wai2kas

  • Beginner
  • *
  • Posts: 17
Re: getting full images on product pages
« Reply #7 on: March 03, 2009, 19:10:55 pm »
Greate solution! I was so nearly close to that  :D

Thanks a lot!

gediweb

  • Beginner
  • *
  • Posts: 13
    • Gediweb Solutions
Re: getting full images on product pages
« Reply #8 on: April 03, 2009, 18:30:48 pm »
I have the older version of Virtuemart: 1.0.12 It works fine now, I'm afraid if I upgrade it, something will go wrong. "If it aint broke dont fix it mentality." On this version I dont have /components/com_virtuemart/themes/default/theme.php Is there a work around for this version? This is exactly what I'm looking for.
Never stop Learning!
http://gediweb.com

wrangler

  • Jr. Member
  • **
  • Posts: 72
Re: getting full images on product pages
« Reply #9 on: April 17, 2009, 09:16:46 am »
Same problem here as gediweb. I am running 1.0.15 and would like to know if there is a workaround of this trick for older versions. Have tried some hacks myself based on the above given instructions but ended up in a disaster (big thanks to the magic word called BACKUP!! :) )

Perhaps macallf can help.

brentwilliams2

  • Beginner
  • *
  • Posts: 2
Re: getting full images on product pages
« Reply #10 on: April 23, 2009, 21:15:00 pm »
Thanks for all the great stuff on here!  I used mmtcbricks code and added the URL to wrap around it, so it would open in a lightbox. 

Code: [Select]
<a href="<?php echo $mosConfig_live_site ?>/components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>" rel="lightbox[product<?php echo $product_id ?>]"><img src='<?php echo $mosConfig_live_site ?>/components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>' style="width: 225px;" alt=''/></a>

wrangler

  • Jr. Member
  • **
  • Posts: 72
Re: getting full images on product pages
« Reply #11 on: April 27, 2009, 19:25:46 pm »
I have tried to PM Macallf for this issue but with no luck :(

gediweb

  • Beginner
  • *
  • Posts: 13
    • Gediweb Solutions
Re: getting full images on product pages
« Reply #12 on: April 28, 2009, 19:05:03 pm »
wrangler, try this http://forum.virtuemart.net/index.php?topic=27250.0 You can specify what size you want to display on the fly page. It takes the big image and resizes it to that size. Hope it helps.
Never stop Learning!
http://gediweb.com

wrangler

  • Jr. Member
  • **
  • Posts: 72
Re: getting full images on product pages
« Reply #13 on: April 29, 2009, 11:42:02 am »
Hi Gediweb
Thanks for the help!!!
This is a great hack and it works great on my VM 1.0.x but what i want to do is have the same thing done on the navigation of the product category as well (ie. when you click on "garden tools" a list of f.e. 60 products show up, which are still showing a blurred thumbnail image).

Anyone, please???

wrangler

  • Jr. Member
  • **
  • Posts: 72
Re: getting full images on product pages
« Reply #14 on: April 29, 2009, 13:23:07 pm »
Ha, I made it. I know, I rock ;-)
Here is the solution, if you want to make images on your product category navigation to automatically use product_full_image instead of product_thumb_image.

Go to administrator/components/com_virtuemart/html/shop.browse.php
Around line 312 find:
Code: [Select]
if( $db_browse->f("product_thumb_image") ) {
                $product_thumb_image = $db_browse->f("product_thumb_image");
}
else {
if( $product_parent_id != 0 ) {
$product_thumb_image = $dbp->f("product_thumb_image"); // Use product_thumb_image from Parent Product
}
else {
$product_thumb_image = 0;
}
}
if( $product_thumb_image ) {
if( substr( $product_thumb_image, 0, 4) != "http" ) {
if(PSHOP_IMG_RESIZE_ENABLE == '1') {
$product_thumb_image = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($product_thumb_image)."&newxsize=".PSHOP_IMG_WIDTH."&newysize=".PSHOP_IMG_HEIGHT."&fileout=";
}

Replace with:
Code: [Select]
if( $db_browse->f("product_full_image") ) {
                $product_thumb_image = $db_browse->f("product_full_image");
}
else {
if( $product_parent_id != 0 ) {
$product_thumb_image = $dbp->f("product_full_image"); // Use product_thumb_image from Parent Product
}
else {
$product_thumb_image = 0;
}
}
if( $product_thumb_image ) {
if( substr( $product_thumb_image, 0, 4) != "http" ) {
if(PSHOP_IMG_RESIZE_ENABLE == '1') {
$product_thumb_image = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($product_thumb_image)."&newxsize=200&newysize=200&fileout=";
}
else {
if( file_exists( IMAGEPATH."product/".$product_thumb_image )) {
                        $product_thumb_image = IMAGEURL."product/".$product_thumb_image;
                    }

That should do it. This automatically uses product full image and scales it down to 200x200 pixels. If you want to use other dimensions, just change the appropriate values on newxsize= and newysize= above.

Cheers!!