News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Message displayed for Empty Categories?

Started by gpullen, August 29, 2012, 14:19:47 PM

Previous topic - Next topic

gpullen

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


gpullen

Hi,  sorry the temp domain was removed and site went live... please try   http://www.bfplantsales.com/stock

thanks


ivus

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 :



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




change to :



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




I hope this helps.

Cornel

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

This is a better code I think.
Because when there are Child category's the text should not be visible for me.


<?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