Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #426670

    Dear Sir,

    I bought the WooCommerce Restrict Categories plugin and it works great but the search function do not work for the website or in Admin mode.

    It shows the result correct in the “AJAX search box” but when pressing enter to see all results it says:

    “Sorry, no posts matched your criteria. Please try another search” but at the same time it says page 1 of 3 and its possible to press 2 and then it shows the hits but when pressing 1 or 3 then it says it won’t find anything.

    BUT when I deactivate this Restrict Categories add-on, the Search function starts to work again?

    Please I would really need your help in understanding how to fix this Before we can launch the page…

    I use wordpress 4.1.1

    Best regards
    Anders

    #426913

    Hey signtronic!

    Thank you for using Enfold.

    We are not familiar with the plugin so it’s better if you contact the plugin author. Anyway, we usually recommend Relevanssi or SearchWP in order to control the search results. If you use the Relevanssi plugin, you can restrict or exclude search on certain pages, tags and categories. Just go to the Settings > Relevanssi > Exclusions and restrictions panel.

    http://kriesi.at/documentation/enfold/use-relevanssi-in-search-instead-of-the-default-search/

    Cheers!
    Ismael

    #427003
    This reply has been marked as private.
    #427243

    Hi!

    Thank you for the info. We would like to test the plugin but but we can’t promise any quick results. When you use the Relevanssi plugin, did you follow the instructions provided in the link above? If you need to add user role exceptions, you can modify the code. Something like this:

    add_filter('avf_ajax_search_function', 'avia_init_relevanssi', 10, 4);
    function avia_init_relevanssi($function_name, $search_query, $search_parameters, $defaults)
    {	
    	if(current_user_can('switch_themes')) {	
        $function_name = 'avia_relevanssi_search';
    	} else {
    	$function_name = 'get_posts';
    	}
        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;
    }
    

    This will only activate the relevanssi query when user is logged in or, to be specific, when anyone who has the capability to switch themes is logged in. Maybe, you can couple this with a user role management plugin. You can choose not to index or to index custom post types and taxonomies in the Relavanssi > Indexing Options section.

    Cheers!
    Ismael

    #427380
    This reply has been marked as private.
    #428648

    Hey!

    It seems to work fine on my installation. Please post the login details here and set it as a private reply. We would like to check it. If possible, please contact the plugin for more info regarding the WooCommerce Restrict Categories extension.

    Use dropbox or mediafire to attach the plugin zip file.

    Cheers!
    Ismael

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