Hi again, so my client requested that seraching by part number too was actualy required.
so i've returned to your earlier post about multiple search fields, here's the code i've updated. all seems to work fine:
public function doProductSearch($data, $form) {
if(isset($data['s'])) {
$filters = array();
foreach(Product::$searchable_fields as $field) {
$filters[] = "$field LIKE '%".Convert::raw2sql($data['s'])."%'";
}
$filter = implode(" OR ", $filters);
}
return array (
'ProductList' => $this->ProductList($filter)
);
}
the only thing not great now, is when your search returns no results, nothing happens. it just shows the default list. how easy is it to display an "your search returned no results" message?
also, is there a way we can include the search query in the result page? just to clearly show that it worked.
even if the search term remained in the search field would be better than what it currently does.
if the search is quite generic, you might not even notice that it worked as the list doesnt change much and there is no success message... does that make sense?