Ok i did a kind of code work around :-/
In the search.php before it does the search....i send the search string to a function and check if its a lone integer, if it is....i prefix my P in front of it and search on "P1060 1060".
Its pretty ugly, cos the search field displays the "P1060 1060". But hey...at least they can definitely search on the product codes now. Oh and I made the search type "any".
function check_int($i) {
// return 0 if not int and return 1 if $i is int
if (ereg("^[0-9]+[.]?[0-9]*$", $i, $p)) {
return 1;
} else {
return 0;
}// end if
}// end check_int
if (check_int($query_string)==1)
{
$query_string = "P".$query_string." ".$query_string;
$option = "any";
//echo $query_string;
}
//**
phpdigSearch($id_connect, $query_string, $option, $refine,
$refine_url, $lim_start, $limite, $browse,
$site, $path, $relative_script_path, $template);
|