News:

Looking for documentation? Take a look on our wiki

Main Menu

Modifying featured products module frontend view

Started by Menace, August 04, 2012, 20:05:19 PM

Previous topic - Next topic

Menace

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?