VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: techrahul87 on April 24, 2012, 08:25:47 AM

Title: No product found message
Post by: techrahul87 on April 24, 2012, 08:25:47 AM
hello everyone...

I am using joomla 2.5 and virtue mart 2.0. Now i want a simple functionality in my project that if there are no products under a category there should be a message "no products found". I have been gone through code of joomla .. but have not found any thing....does any body have done that...
Title: Re: No product found message
Post by: AbsoluteVM on May 04, 2012, 17:35:39 PM
I created my own which might be a bit simple/crap, but it works.

I'm using template overrides, so in templates/myTemplate/html/com_virtuemart/category/default.php

I added:

<?php
// There are no products message

   if ($this->category->haschildren) {
      // don't output the message
   } else {
      echo '<h1>No products found</h1>';
   }
?>

Before
<?php
/* Show child categories */

if ( VmConfig::get('showCategory',1) ) {
   if ($this->category->haschildren) {

      // Category and Columns Counter
Title: Re: No product found message
Post by: techrahul87 on May 12, 2012, 09:52:58 AM
thanks AbsoluteVM ;-) nice one..