• Resolved misdim

    (@misdim)


    Hello!

    Lets say that I have a book with ISBN 9789601658810 which is included in the product description.
    If I search for the book with the ISBN, it shows the correct book as a result if I type
    9789601658810 or 978-960-165881-0
    But if I type it like this 978-960-16-5881-0 it shows 2 other irrelevant books and not the right one at all.

    And the problem is that the correct formats for the ISBN is 9789601658810 (which is working fine at the search) or 978-960-16-5881-0 (which is not fetching the right book as a result)

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Hi @misdim

    You can try to remove dashes from the phrase before it goes to the search engine.

    add_filter( 'dgwt/wcas/phrase', function ( $phrase ) {
      $phrase = str_replace( '-', '', $phrase );
      return $phrase;
    } );

    You have two ways to add this code to your theme:
    Open the functions.php in your child theme and add the code at the end.
    or install the Code Snippets plugin and apply this code as a snippet.

    Regards,
    Kris

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with dashes’ is closed to new replies.