Page List search with number is not correct
Permalink
Hi all, I'm having a problem to search for products by its keywords.
Here a little code:
This works fine when I enter a "string" (like "C8000", which is a product name), but the search result is empty when keyword is a number (like "8000"). : -(
Any recommendations?
Here a little code:
public function view() { $productList = new PageList(); $productList->sortByDisplayOrder(); if (!empty($_GET['cKeyword']) && $q = trim($_GET['cKeyword'])) { $productList->filterByKeywords($q); } $productList->setItemsPerPage(10); $this->set('productList', $productList); $this->set('productResults', $productList->getPage()); }
This works fine when I enter a "string" (like "C8000", which is a product name), but the search result is empty when keyword is a number (like "8000"). : -(
Any recommendations?
(This assumes you have a page attribute with the handle "keywords", and that it's a textbox type -- not a "select" type attribute).