I have a Wordpress Woocommerce web site. When i'm searching the greek version of my web site, the tags, categories, product names, description etc. that are in greek, the search is not working very well because of words that have characters with tone (like ά, έ, ή, ί, ό etc.)
Is any method to replace or match the characters with tone with characters without tone (ά with α, έ with ε, ή with η etc.). I prefer matching than replacing but if it not possible, let just replace them.
I have this code from another non wordpress website witch is replacing the tone characters with non tone charachters
$s = $_GET["s"];
if (isset($s)) {
$sql = mysqli_query($con, "SELECT * FROM table WHERE word LIKE '%$s%' ORDER BY word");
while($RS = mysqli_fetch_array($sql)) {
$result = str_replace("ά","α",$RS['prword']);
$result = str_replace("έ","ε",$result);
$result = str_replace("ή","η",$result);
$result = str_replace("ί","ι",$result);
$result = str_replace("ό","ο",$result);
$result = str_replace("ύ","υ",$result);
$result = str_replace("ώ","ω",$result);
echo $result;
}
}
But i don't know how to use it with wordpress php hooks.