News:

Looking for documentation? Take a look on our wiki

Main Menu

Hot to remove thumbnail in products

Started by domkart, June 18, 2012, 08:58:00 AM

Previous topic - Next topic

domkart

Hi everyone,
I try to remove thumbnail in product details



I want only the main picture with out thumbnail cause i add 1 picture to 1 product
Any idea how to remove it ?

in code i found additional-images but dont know how to modificate it
Joomla 1.7
VM 2.0.6

jenkinhill

#1
That looks like VirtueMart 2 ??  You posted this in the VM1.1. area of the forum - moving to correct section.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

domkart

Ohh yes, sorry for my mistake its 2.0.3 version
Joomla 1.7
VM 2.0.6

Artanis

#3
Open this file: \components\com_virtuemart\views\productdetails\tmpl\default_images.php

If You simply want to remove additional images completly, simply comment out or delete this portion:

<div class="additional-images">
<?php
// List all Images
if (count($this->product->images) > 0) {
    foreach ($this->product->images as $image) {
echo '<div class="floatleft">' $image->displayMediaThumb('class="product-image"'true'class="modal"'truetrue) . '</div>'//'class="modal"'
    }
}
?>

        <div class="clear"></div>
    </div>


But if You want for this additional image block to show up only when there are more than one image, change above segment to this:


<div class="additional-images">
<?php
// List all Images
if (count($this->product->images) > 1) {
    foreach ($this->product->images as $image) {
echo '<div class="floatleft">' $image->displayMediaThumb('class="product-image"'true'class="modal"'truetrue) . '</div>'//'class="modal"'
    }
}
?>

        <div class="clear"></div>
    </div>



P.S. Best and right way is to not modify Virtuemart components themslefs, but to create new so called override file in \templates\yourtemplate\html\components\com_virtuemart\views\productdetails\tmpl\default_images.php
Animus Project - Design Studio
Running Joomla 2.5.6, Virtuemart 2.0.6a, PHP 5.3.10

7racecar7

Would there be a way to choose what additional images are shown?  For example, I would like to remove the default photo (the one that is large to start with) in the thumbnail section,  could i somehow get the thumbnails to start with the 2nd image?

7racecar7

figured it out (array_slice($this->product->images,1) as $image)