VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: giofranz on October 19, 2018, 17:04:07 PM

Title: Show description in category without products
Post by: giofranz on October 19, 2018, 17:04:07 PM
Hi guys, i'm using vm 3.4.2 on joomla 3.8.13.
My problem is simple, i want to show the category description even when there are no products in it.

For example, i have a main category A that has two child category B1 B2, I would like to have a menu that displays A with the description of A and the image preview of B1 and B2.
If A has products in it, then it shows in order: B1 and B2 images; the A description; and the products of B1 and B2. But when A has no products in it, the menu just shows image preview of B1 and B2.

Have you any idea?

Thank you in advance!
Title: Re: Show description in category without products
Post by: GJC Web Design on October 19, 2018, 17:09:49 PM
totally template dependent

most cat templates have something like

if (!empty($this->showcategory_desc) and empty($this->keyword)){
if(!empty($this->category)) {
?>
<div class="category_description">
<?php echo $this->category->category_description?>
</div>
<?php }
if(!empty($this->manu_descr)) {
?>

        <div class="manufacturer-description">
<?php echo $this->manu_descr?>
        </div>
<?php }
}


play around with the ifs to get what u want
Title: Re: Show description in category without products
Post by: giofranz on October 22, 2018, 09:36:11 AM
Thank you GJC Web Design, I'll see what I can get!