VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: qwerty678 on September 02, 2015, 16:11:53 PM

Title: Remove Browse Controls When a Category Is Empty
Post by: qwerty678 on September 02, 2015, 16:11:53 PM
Hello,
I want to hide the browse controls (manufacture, pagination etc) when the category has no products.

I try to change inside the template and inside the vm 3 the line

if$this->showproducts{ ?>

to
if(!empty($this->showproducts)){ ?>

But nothing happens.
Is there any other line that I have to change?

I'm using Vm3 and joomla 3.
Thank you.
Title: Re: Remove Browse Controls When a Category Is Empty
Post by: GJC Web Design on September 02, 2015, 16:30:14 PM
if$this->showproducts{ ?>  is just the config setting

you would need something like

if ($this->showproducts && $this->products  ) { ?>

maybe .. something similar anyway
Title: Re: Remove Browse Controls When a Category Is Empty
Post by: z-analysts on September 06, 2015, 23:49:27 PM
Thank you GJC Web Design for the hint! I was looking for the right place to make the change. Here is the code that worked for me:

if (($this->showproducts) && (!empty($this->products))) {