Author Topic: Message displayed for Empty Categories?  (Read 3962 times)

gpullen

  • Beginner
  • *
  • Posts: 7
Message displayed for Empty Categories?
« on: August 29, 2012, 14:19:47 pm »
Hi,

Is it possible to display a message when a category is empty?? I have searched but not found any answer for VM2!!

Please see the site in development here: http://new.bfplantsales.com/stock
When you go to an empty category, you just get a blank page!!

Thanks
Gareth

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: Message displayed for Empty Categories?
« Reply #1 on: August 29, 2012, 17:03:31 pm »
nice link. deosn't work.

gpullen

  • Beginner
  • *
  • Posts: 7
Re: Message displayed for Empty Categories?
« Reply #2 on: August 30, 2012, 13:43:05 pm »
Hi,  sorry the temp domain was removed and site went live... please try   http://www.bfplantsales.com/stock

thanks

gpullen

  • Beginner
  • *
  • Posts: 7
Re: Message displayed for Empty Categories?
« Reply #3 on: September 04, 2012, 17:48:43 pm »
Any ideas? thanks

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: Message displayed for Empty Categories?
« Reply #4 on: September 05, 2012, 02:39:30 am »
Hi gpullen,

yeah you need to edit the following file "/components/com_virtuemart/views/category/tmpl/default.php" @ line 319 (right at the bottom). Look for :

Code: [Select]

<?php } elseif ($this->search !==null ) echo JText::_('COM_VIRTUEMART_NO_RESULT').($this->keyword' : ('$this->keyword')' '')
?>



change to :

Code: [Select]

<?php
} elseif ($this->search !==null ) {
echo JText::_('COM_VIRTUEMART_NO_RESULT').($this->keyword' : ('$this->keyword')' '');
} else {
echo 'CATEGORY EMPTY';
};
?>



I hope this helps.

Cornel

  • Beginner
  • *
  • Posts: 21
Re: Message displayed for Empty Categories?
« Reply #5 on: September 05, 2012, 07:47:11 am »
Why is this code NOT into the product yet........... every shop owner wants to give info to their customer.

Can this be proposed, so it will be in the next VM version ?

ocean1

  • Jr. Member
  • **
  • Posts: 63
    • Schneider Webdesign
Re: Message displayed for Empty Categories?
« Reply #6 on: October 21, 2012, 21:43:58 pm »
This is a better code I think.
Because when there are Child category's the text should not be visible for me.

Code: [Select]
<?php
} elseif ($this->search !==null ) {
echo JText::_('COM_VIRTUEMART_NO_RESULT').($this->keyword' : ('$this->keyword')' '');
} elseif (!
$this->category->haschildren) {
echo 'CATEGORY EMPTY<br><a href = "javascript:history.back()">Back to previous page</a>';
};
?>


burnego

  • Beginner
  • *
  • Posts: 4
Re: Message displayed for Empty Categories?
« Reply #7 on: December 09, 2013, 13:58:18 pm »
thanks ocean1. works great