Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1011324

    Dear support team,
    the ajax search function is not working properly. It shows the information: “Entschuldigung, aber kein Eintrag erfüllt Deine Suchkriterien
    Bitte verwende einen anderen Suchbegriff”, although the search item is existing, and by clicking the search symbol the search list appears.
    I hope, you have an idea to hide this information.

    Thanks!

    #1011334

    Hey elsengold,

    The default ajax search does not incclude products, etc. If you want to enhance the search algorithm you can install a plugin like Relevanssi ( https://de.wordpress.org/plugins/relevanssi/ ). Then add this code to your child theme:

    
    
    add_filter('avf_ajax_search_function', 'avia_init_relevanssi', 10, 4);
    function avia_init_relevanssi($function_name, $search_query, $search_parameters, $defaults)
    {
        $function_name = 'avia_relevanssi_search';
        return $function_name;
    }
    
    function avia_relevanssi_search($search_query, $search_parameters, $defaults)
    {
        global $query;
        $tempquery = $query;
        if(empty($tempquery)) $tempquery = new WP_Query();
    
        $tempquery->query_vars = $search_parameters;
        relevanssi_do_query($tempquery);
        $posts = $tempquery->posts;
    
        return $posts;
    }
    
    

    to use Relavanssi for the ajax search too.

    Best regards,
    Peter

    #1011801

    Hey Dude,
    thank you, that works perfectly.

    Best regards,
    else

    #1011809

    Hi,

    Great, glad I could help you :)

    Best regards,
    Peter

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