• Resolved WildFire

    (@wildfire9859)


    hello

    i think search doesn’t work correctly when there’s special character in the phrase , for example when i try to search for something like assassin’s creed which has the special character ( ‘ ) in one of its words , i get stuck on loading bar and no result is displayed.

    also i think it would be great if you can make adjustment to plugin so that even if someone simply search for “assassins creed” without puting that special character , all the results even with special characters be displayed aswell.

    for example someone search for “assassins creed” , but aside from the results for this phrase , the results for the “assassin’s creed ” which has a special character in the middle of it , also be displayed

    thank you in advance for your help with this matter

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @wildfire9859!

    In the free version, you can use this code snippet to replace the original phrase with another to avoid getting no results.

    add_filter( 'dgwt/wcas/phrase', function( $keyword ) {
    $replacements = array(
    'assassins' => "assassin's",
    'children' => "child's",
    // Add more phrases
    );

    foreach ( $replacements as $original => $replacement ) {
    $keyword = preg_replace( '/\b' . preg_quote( $original, '/' ) . '\b/i', $replacement, $keyword );
    }

    return $keyword;
    } );

    You have two ways to add this code to your theme:

    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the Code Snippets plugin and apply this code as a snippet.

    Best regards,
    Kris

    Thread Starter WildFire

    (@wildfire9859)

    thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.