News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove the first/main image

Started by bobthebob01, February 02, 2012, 09:18:26 AM

Previous topic - Next topic

bobthebob01

Hi,

first: well done to the VM team for this release. It becomes much better and easier to dev/customize the template since VM is using views now. And with the template overrides, it's even better. Or the way it should be one could say.

Second: i have a little problem with the "show additional images" on the product page, even if using the default view.
The following snippet does show the thumbnail of the first image and it is said that it would show all images but the first one as per this post: http://forum.virtuemart.net/index.php?topic=90935.0
or as follow:

<?php if(!empty($this->product->images) && count($this->product->images)>1) {
         foreach (
$this->product->images as $image) {
            echo 
$image->displayMediaThumb('class="product-image"',true,'class="modal"'); //'class="modal"'
         
}
}
?>



Does anybody have an idea how i can remove the first/main image from the thumbnails list?

thanks

Gruz


Quick answer is:
<?php if(!empty($this->product->images) && count($this->product->images)>1) {
         
$first true;
         foreach (
$this->product->images as $image) {
            if (
$first)   {
                  
$first false;
                  continue;
            }
            echo 
$image->displayMediaThumb('class="product-image"',true,'class="modal"'); //'class="modal"'
         
}
}
?>



Full answer is here:
http://forum.virtuemart.net/index.php?topic=97365.msg322269#msg322269
Your installable language for VM2: http://gruz.org.ua/virtuemart-language-files.html