Reply To: Blank speces in search and copy and paste search terms

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Blank speces in search and copy and paste search terms Reply To: Blank speces in search and copy and paste search terms

#14560

leelnj
Participant

hello. my client has bought your plugin and we have configured it but we have one issue. we have order references such as B30-25-595. if a client types in B30-25-595 it will display results but if they type in B3025595 it will show no results. It will work if i type in B30 25 595 which is great and needed as well but not when there is no space eg B3025595 . I have tried to use the following code from your knowledgebase to remove hypens but it doesnt work
// —- !!! ONLY COPY PASTE CODE BELOW THIS LINE to the functions.php in your theme directory !!! —-
add_filter('asp_search_phrase_before_cleaning', 'asp_replace_characters', 10, 1);
add_filter('asp_query_args', 'asp_replace_characters', 10, 1);
function asp_replace_characters( $s ) {
$characters = “',._-/?!”; // Type characters one after another
$replace_with = ”; // Replace them with this (space by default)
if ( is_array($s) ) {
if ( isset($s['s']) && !$s['_ajax_search'] )
$s['s'] = str_replace(str_split($characters), $replace_with, $s['s']);
} else {
$s = str_replace(str_split($characters), $replace_with, $s);
}
return $s;
}

This is critical for my client so appreciate your response asap
2.) I really need my keyword suggestion to be using taxonomy term suggestions. has this been fixed?
” I've looked up the source, and it seems like that the taxonomy term suggestions does not respect the maximum suggestions count. As a temporary solution, I have disabled term suggestions for now:”