Hello all!
I use the featured products module and by default the setup of it is to show the "no image available" file if the product has no image.
What I want to achieve is to display the thumb of the parent category if no product image is available.
I already did some changes in the file .../modules/mod_virtuemart_product/tmpl/default.php but I don't get this issue solved.
Here is the code I'm struggling with:
<?php
if (!empty($product->images[0])) {
$image = $product->images[0]->displayMediaThumb ('class="featuredProductImage" border="0"', FALSE);
} else {
$image = '';
}
echo JHTML::_ ('link', JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id), $image, array('title' => $product->product_name));
echo '<div class="clear"></div>';
$url = JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' .
$product->virtuemart_category_id); ?>
Any ideas how to do that?
I tried
else {
$image = $category->images[0]->displayMediaThumb ('class="featuredProductImage" border="0"', FALSE);;
}
But that leaves me a blank site
And additionally: Can I use overrides for modules?