Answer the question
In order to leave comments, you need to log in
How to get virtuemart product image url?
Good afternoon,
Please tell me, when displaying a page with a product, an image is displayed in the default_images.php file with the following code:
if (!empty($this->product->images)) {
$image = $this->product->images[0];
?>
<div itemscope itemtype="http://schema.org/ImageObject" class="main-image img-fluid m-2">
<?php
$width = VmConfig::get('img_width_full', 0);
$height = VmConfig::get('img_height_full', 0);
if(!empty($width) or !empty($height)){
echo $image->displayMediaThumb("",true,"rel='vm-additional-images' itemprop='thumbnailtrue'", true, false, $width, $height);
} else {
echo $image->displayMediaFull("",true,"rel='vm-additional-images' itemprop='image'");
}
?>
<div class="clear"></div>
</div>
<?php
Answer the question
In order to leave comments, you need to log in
Try this:
Paste this after the line:
echo '<p>'.$image->file_url.'</p>';
$image = $this->product->images[0];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question