VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: wicketts on April 21, 2017, 16:08:19 PM

Title: VM Search Error
Post by: wicketts on April 21, 2017, 16:08:19 PM
Hello everyone,

I have an issue with our site which I was hoping someone might be able to help me fix.

We have the VM search box on the site and it works fine if you type in a phrase that partly matches a product. If however you type in something random or the name of a product that does not exist in the shop, the page reloads with no product results and the error:

Notice: Undefined property: VirtuemartViewCategory::$search in public_html/templates/axxen/html/com_virtuemart/category/default.php on line 356

Does anyone know how I might be able to fix this?

Kind regards


James
Title: Re: VM Search Error
Post by: GJC Web Design on April 21, 2017, 23:30:21 PM
it is in your template  category over ride

test without it.. if fixed compare and fix your code.. 

it will need something like

if(isset($search)) {

blah blah

}
Title: Re: VM Search Error
Post by: wicketts on May 01, 2017, 13:12:55 PM
Hi GJC,

Thank you for your help.

I found the problem. I had to change:

} elseif ($this->search !== NULL) {

on line 356 to

} elseif ($this->searchcustom !== NULL) {


All working now.

Thanks again!