Author Topic: Resizing thumbnail size  (Read 4748 times)

workoutman

  • Beginner
  • *
  • Posts: 38
Resizing thumbnail size
« on: December 12, 2009, 23:06:53 pm »
Hi,

I've read info at:

http://forum.virtuemart.net/index.php?topic=46136.msg169114

However none of these solutions work for me.   I removed <?php echo product_image ?> and replaced it with:
Code: [Select]
<img src='components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>' style="width: 200px;" alt=''/>
However no image displayed.  I have dynamic resizing off

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.

Nothing changed with this solution.


I found more info at:
http://forum.virtuemart.net/index.php?topic=27250.0
With this solution, all I got was text that said Product_Name aligned right. 

http://forum.virtuemart.net/index.php?topic=58118.0
I turned off dynamic resizing and nothing changed.

Any other ideas??  I just want the thumbnail size larger!

Ty

romanvictor

  • Beginner
  • *
  • Posts: 3
Re: Resizing thumbnail size
« Reply #1 on: October 11, 2010, 19:06:59 pm »
This is how I solved this problem of getting large images on the product detail page.

In the file:

\components\com_virtuemart\themes\YOURTHEME\templates\product_details\flypage_images.tpl.php

Replace:

<?PHP echo $product_image ?>

With:

<?PHP
 $myimagepath='/components/com_virtuemart/shop_image/product/'.$product_full_image;
?>
 <a href="<?=$myimagepath ?>" rel="lightbox[product<?=$product_id?>]"><img src="<?=$myimagepath ?>" class="browseProductImage" border="0" title="<?=$product_name?>" alt="<?=$product_name?>" width="400" /></a>

Roman

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10385
  • VirtueMart Version: 3+
Re: Resizing thumbnail size
« Reply #2 on: October 11, 2010, 19:15:06 pm »
this is the code I use for large image on flypage

<img src="components/com_virtuemart/shop_image/product/<?= $product_full_image ?>" alt="<?= $product_name ?>" /><br/><?php echo $this->vmlistAdditionalImages( $product_id, $images ) ?>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)