I have several fields I do not use in the Products Admin page (see attachment) like "Product is Children of" and "Manufacturers".
Would it be possible to display the "file_url" (the database field from xxxxx_virtuemart_medias table) there instead?
Joomla 3.9.13 / VirtueMart 3.6.8 10197
is up to you .. most values are available in $this->productlist in administrator\components\com_virtuemart\views\product\tmpl\default.php
just override it in the isis template and display what u need
Nice!
This seems to do the trick:
if (!empty($product->images)) {
$image = $product->images[0];
echo $image->file_url;
}
For some reason this didn't seem to work anymore after an upgrade to Joomla 4.
But the code I provided in 2019 (the post above) is not complete, this took me a while to figure out (again!).
So for future reference and anyone else who needs this, this is the correct code:
$this->model->addImages($product,1);
if (!empty($product->images)) {
$image = $product->images[0];
echo $image->file_url;
}
I assume it depends on the number of products displayed .. after I think 30 the images are not attached to the object