The server GD2 library does not support the .svg format - and VM uses GD2 to create thumbs.
For using .svg image files for products see http://forum.virtuemart.net/index.php?topic=146852.msg535194#msg535194
I'm so sorry but this is big problem create control function in PHP and don't create thumb if is SVG and show it?
Quote from: jenkinhill on November 02, 2023, 16:08:29 PM
The server GD2 library does not support the .svg format - and VM uses GD2 to create thumbs.
SVG is a vector file and there is no need to make thumbnails at all, because the vector file is scalable from 1px to infinity
The lack of SVG support in Virtuemart is nothing more than the developer's ignorance.
There is a quite simple solution to this.
Upload raster files in jpg/png format to Virtuemart normally, and place SVG files with the same name in a separate folder.
in my case the equivalent of a folder
/images/virtuemart/productis
/images/virtuemart/svgin virtuemart template add this code to any php file which is in this path
../com_virtuemart/productdetails/for ($i = 1; $i < count($this->product->images); $i++) {
$jpg = $this->product->images[$i]->file_url;
$svg = str_replace(array('.png', '.jpg', 'product'), array('.svg', '.svg', 'svg'), $jpg)
$test = file_exists($svg);
<?php
if (!$test) { ?>
<img src="<?php echo JURI::root().$jpg; ?>"/>
<?php } else { ?>
<img src="<?php echo JURI::root().$svg; ?>"/>
<?php }} ?>
For me, this solution with identical graphics in png and SVG format makes sense, because on my website I only display SVG, but I export the link to images in png format with an identical image separately to an XML file for other domains where svg files are not accepted (amazon /ebay etc..)