Author Topic: Virtuemart module category with thumbnails [SOLVED]  (Read 6181 times)

babouz

  • Beginner
  • *
  • Posts: 22
Virtuemart module category with thumbnails [SOLVED]
« on: April 15, 2013, 17:09:45 pm »
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

  • Beginner
  • *
  • Posts: 22
Re: Virtuemart module category with thumbnails
« Reply #1 on: April 15, 2013, 17:51:12 pm »
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)'

Code: [Select]
$Zecatimg = '<img alt="" src="'.JURI::base(true).'/'.$c->images[0]->file_url_thumb.'" />';
and then for each <li> :

Code: [Select]
<?php echo '<div>'.$Zecatimg.'</div>'?>
But it doesn't work... I don't have the url... The source code gives me this :
Code: [Select]
<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

  • Beginner
  • *
  • Posts: 22
Re: Virtuemart module category with thumbnails
« Reply #2 on: April 16, 2013, 11:41:30 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27909
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.5 10338 on Joomla 3.9.22 PHP 7.4.9

babouz

  • Beginner
  • *
  • Posts: 22
Re: Virtuemart module category with thumbnails
« Reply #4 on: April 16, 2013, 12:35:44 pm »
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 :

Code: [Select]
<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.