Author Topic: Remove the first/main image  (Read 2149 times)

bobthebob01

  • Jr. Member
  • **
  • Posts: 117
Remove the first/main image
« on: February 02, 2012, 09:18:26 am »
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:
Code: [Select]
<?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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 159
  • Copyleft (є) all rights reversed
Re: Remove the first/main image
« Reply #1 on: February 09, 2012, 13:14:37 pm »

Quick answer is:
Code: [Select]
<?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:
Code: [Select]
http://forum.virtuemart.net/index.php?topic=97365.msg322269#msg322269
Your installable language for VM2: http://gruz.org.ua/virtuemart-language-files.html