Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #787503

    Hi there!

    Is there a snippet to include specific custom fields into the AJAX search?

    Thanks!

    #787995

    Hey blafoley,

    No, our search handles just one parameter.
    You might want to consider using a plugin for that. Here is some reading on the topic http://www.wpbeginner.com/showcase/12-wordpress-search-plugins-to-improve-your-site-search/

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #789875

    I am using relevanssi plugin and the Enfold Search Dropdown doesn’t include the included search parameters set in Relevanssi and produces separate results. For the sake of consistency, it is in my clients best interest to disable the AJAX dropdown. How can I disable the AJAX search dropdown but keep the search magnify glass in the menu?

    #790229

    Hi blafoley,

    You can make a custom form and code that would handle that form submit. You might want to hire a freelancer to that for you.

    Here are some threads to consider
    https://kriesi.at/support/topic/enfold-removing-the-search-magnifying-glass-and-adding-in-the-search-field/
    https://kriesi.at/support/topic/searchbox-in-header-menu/#post-267356

    Best regards,
    Victoria

    #790482

    Hi Victoria,

    I don’t think you’re understanding my question. I don’t want to remove the Enfold search magnify glass, nor do I wish to replace it with anything else.

    I want to remove the Ajax dropdown of search results once you start typing. I will find a work around it.

    #790532
    add_filter('avf_frontend_search_form_param', 'avia_deactivate_ajax_search',10,1);
    function avia_deactivate_ajax_search($params)
    {
    	$params['ajax_disable'] = true;
    	return $params;
    }

    This solved my problem to just remove the AJAX dropdown but keep the Magnify Glass in the main menu.

    #790821

    Hi,

    Great, glad you found a solution and thanks for sharing, much appreciated :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #987889

    Hi Guys, it is really necessary to include some custom fields in the search. Maybe someone can help?

    With this i already extended the standard search to find the Woocommerce SKU´s :
    http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join

    MAybe with this we can combine my needs

    #988225

    Hi hunter74,

    Can you please explain a bit more what you’re trying to achieve?

    Best regards,
    Victoria

    #988630

    Hi Victoria,

    with my explanation above I could expand the standard WordPress Search. The Searchmodul now also including the SKU of my Product.

    But When I make a search in the Ajax Searchfield with typing the SKU of my product, the product can not be found.

    I hope it is not so difficult to add this to the Ajax Search.

    #989284

    Hi,

    I can only point you to the right direction because this topic is beyond the scope of our support forum. You an use this code to modify the ajax search query:

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

    Basically you need to replace

    
        $tempquery->query_vars = $search_parameters;
        new WP_Query($tempquery);
    

    with your custom query code – i.e. add additional query/search parameters or call a custom query function (like relevanssi_do_query() if you’re using Relevanssi ( https://www.relevanssi.com/knowledge-base/relevanssi_do_query/ ).

    Best regards,
    Dude

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