News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart module category with thumbnails [SOLVED]

Started by babouz, April 15, 2013, 17:09:45 PM

Previous topic - Next topic

babouz

Hello, everybody !
I would like to make a simple thing (well I thought it would be simple :()... I would like to use the virtuemart module category to show, in an article, some child category of a parent with their own thumbnails... unfortunately this module can't do this... Only the title with an url is shown....
Is there anybody who have already makes this change ? I will appreciate any help :)
Thank you !
Where is mum? She is in the bathroom. Where is dad? He is not at home. Why? I don't know.

babouz

I'm not a developper... but I know how to create an image... the only things that I need is the way to write the url...

I've added to 'foreach ($categories as $category)'

$Zecatimg = '<img alt="" src="'.JURI::base(true).'/'.$c->images[0]->file_url_thumb.'" />';

and then for each <li> :

<?php echo '<div>'.$Zecatimg.'</div>'?>

But it doesn't work... I don't have the url... The source code gives me this :
<div><img alt="" src="/" /></div>

Would be great if a nice developper could help me ;D
Where is mum? She is in the bathroom. Where is dad? He is not at home. Why? I don't know.

babouz

Nobody want to give me a hand on this issue ?
please I really need to do this...
Where is mum? She is in the bathroom. Where is dad? He is not at home. Why? I don't know.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

babouz

Ok I found by my own way...

I don't know if it's really good to do like this but in mod_virtuemart_category.php there was some lines which was commented... so I removed comments and I modified default.php like this :

<ul class="VMmenu<?php echo $class_sfx ?>" id="<?php echo "VMmenu".$ID ?>" >
<?php foreach ($categories as $category) {
$active_menu 'class="VmClose"';
$caturl JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$category->virtuemart_category_id);
$cattext $category->category_name;
$Zecatimg '<div><a href="'.$caturl.'" title="'.$cattext.'"><img alt="" src="'.JURI::base(true).'/'.$category->images[0]->file_url_thumb.'" /></a></div>';
//if ($active_category_id == $category->virtuemart_category_id) $active_menu = 'class="active"';
if (in_array$category->virtuemart_category_id$parentCategories)) $active_menu 'class="VmOpen"';

?>


<li>
<div >
<h2><?php echo JHTML::link($caturl$cattext);?></h2>
        <?php echo '<div>'.$Zecatimg.'</div>' ;?>
</div>


Now that's done, I get the category image with a link to the category :)
Where is mum? She is in the bathroom. Where is dad? He is not at home. Why? I don't know.