Good afternoon, faced with the following problem. I can not add a class for the product image in the product card.
As far as I understand, one of the files view \ productdetails \ tmpl \ default_images.php or default_images_additional.pxp is responsible for processing. But unfortunately nothing happens.
Tell me, please, how best to add a class for a product photo?
UPD.: Sorry for the small amount of information ...
Joomla Version - 3.7.4
VM version - 3.2.4
PHP version is 5.6.30 + dfsg-0 + deb8u1
VM Template - standard, which went by default
Link for example - https://test.dartharth.ru/katalog/plavayushchie-vodyanye-lilii/liliya-6
The problem is adding a css class for the product image that is inside the block with the class "vm-product-media-container"
OK http://forum.virtuemart.net/index.php?topic=128401.0
why not target it with
.vm-product-media-container > img {
}
its the same thing
Quote from: GJC Web Design on September 14, 2017, 23:30:01 PM
why not target it with
.vm-product-media-container > img {
}
its the same thing
The fact is that a class is necessary for processing a photo by a plug-in that reacts only to a class of photos.
For default VM templates using .main-image > img would be more specific. Unless you use template overrides which us a different class already.
use a Js snippet to ad a class?
not tested
<script type="text/javascript">
jQuery(document).ready(function($){
$('.main-image > img').addClass('my_img_class');
});
jQuery.noConflict();
</script>
Hi,
for the main image open default_images.php and add the class attribute and name in the displayMediaFull function like this :
Before
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
After
echo $image->displayMediaFull("class='MyClassName'",true,"rel='vm-additional-images'");
the same way you can add a class to additional images.