Resize images on the product detail page
Maybe it is an additional feature or just a correct working image-resizer in Virtuemart. But we have also extended it a bit for Virtuemart VMX…
Normally, Virtuemart only uses the image-dimensions you have configured in the Virtuemart configuration. But often the images are needed in different sizes. Now you can do it without problems – and the best thing: the resize script is only called once per image. After the resized image is once created, our improved script recognizes this and directly creates a URL with the image filename. This is slightly better for SEO but it is better for the local cache or most browsers.
How to use it you might know the image_tag function from some templates. Just add some parameters to resize the images individually for each theme. This is what you can find in a default browse-template:
<?php
...
echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' )
...
?>
<?php
...
echo ps_product::image_tag(basename($product_full_image), 'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"',1,'product',250,300 )
...
?>
This can be used in all themes where you want to display images. A good way for example to show very small thumbs in the cart.