Support » Plugin: Advanced Woo Search » When searches for a specific product, the search results are not correct.

  • Resolved Pixmi

    (@pixmi)


    Hello,
    When my website searches for a specific product, the search results are not correct,
    the search keyword is ‘M&P9’, and the results are as follows
    /s=M%26P9&post_type=product&type_aws=true&id=1&filter=1

    But the result I want to appear is
    /?s=M%26P9&post_type=product&id=1&filter=1

    The latter difference is that I removed the parameter ‘type_aws=true’,

    Should be ‘&’ characters interfere with search results,

    Currently I changed ‘type_aws = true’ to ‘type = true’ to temporarily make the search results correct, But AJAX will not change.

    How should I make the correct correction?

    Plug-in version
    Advanced Woo Search PRO 1.87
    WooCommerce 3.93

    Theme
    Ocean Extra 1.5.20

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    So, your problem is that plugin removes ‘&’ characters from the search query and display products with ‘MP9’?

    The problem here is that by default plugin removes all special characters from the search string. But you can change this behavior. Please add following code snippet

    add_filter( 'aws_special_chars', 'my_aws_special_chars' );
    function my_aws_special_chars( $chars ) {
        unset( $chars[array_search( '&',$chars )] );
        unset( $chars[array_search( '&',$chars )] );
        unset( $chars[array_search( '&',$chars )] );
        return $chars;
    }

    After adding this code you will also need to re-index plugin table.

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘When searches for a specific product, the search results are not correct.’ is closed to new replies.