Forums Forums Search & Filter Pro Filter not working.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #18323

    I’ve installed the search filter and set up my taxomnies and other things to search by, i have tried everything! but some some reason instead of display results it just displays every single post.

    I have a custom template called properties.php and this is the template for the page and what the results should show on, I’m using a standard wordpress loops, i even grabbed the one from the wordpress price to see if it works.

    It filters by price, but thats it, My taxomnoies are set up fine as far as i’m aware.

    I’ve tried all the normal, different loops, disabled all plugins..nothing seems to work.

    I can send over login details if you want to have a poke around, but via email not through this site.

    the site is http://inhomeestates.co.uk/beta/

    Ross Moderator
    #18351

    Hi Daniel

    It seems as though the JS file for S&F is not being loaded – so you will probably find that ajax doesn’t work or auto submit amongst other things.

    What I expect to see in hte html source is a reference to search-filter-build.js

    Is there anything you can think of as to why it might not be loading on your site?

    Thanks

    Anonymous
    #18471

    Should the plugin not auto add that JS file? I pretty much installed the plugin thats it and tried to make it work with the theme i’m using a standard wordpress loop.

    Auto submit is also on.

    I’m not sure why its doing this, it needs to be sorted as soon as possible really, Would you mind having a look see what the problem is? i can send over login details etc.

    thank you.

    Ross Moderator
    #18472

    Hi Daniel,

    The plugin of course adds this, which is why I asked if you could think of a reason that it wouldn’t be showing up.

    This plugin lazy loads the JS, so its not loading the JS files on all your pages (ie pages where its not needed) – but it seems that maybe your theme doesn’t support this or has some non standard way of handling scripts.

    For now you can add this to your functions.php:

    	wp_register_script( 'search-filter-plugin-build', 'http://www.yoursite.com/wp-content/plugins/search-filter-pro/public/assets/js/search-filter-build.js', array('jquery'), '1.4.3' );
    	wp_localize_script('search-filter-plugin-build', 'SF_LDATA', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'home_url' => (home_url('/')), 'sfid' => '' ));
    	
    	wp_register_script( 'search-filter-chosen-script', 'http://www.yoursite.com/wp-content/plugins/search-filter-pro/public/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.4.3' );
    	
    	wp_enqueue_script( 'search-filter-plugin-build' );
    	wp_enqueue_script( 'search-filter-chosen-script' );
    	wp_enqueue_script( 'jquery-ui-datepicker' );

    Which will add the scripts back in to you site (obv replace “yoursite.com”).

    I will add an option the next version so that you can choose to enable lazy loading.

    Thanks

    Anonymous
    #18520

    Still doesn’t work, do you mine taking a look? maybe its set up wrong or something or something is missing.

    Cheers.

    http://inhomeestates.co.uk/beta/properties/

    Ross Moderator
    #18596

    You didn’t replace “yoursite.com” in the above code snippet.

    Thanks

    Anonymous
    #18624

    My mistake,

    Right sorry to be a pain! this now loads which is great!

    Any idea why when i select one it loads, then if i select another it doesn’t? but when i click search it looks like it clears it and shows all properties any?

    Ross Moderator
    #18718

    Hi Daniel

    What’s happening here is your search form is inside your “results container” (this setting can be found on the “display results” tab).

    So when an ajax request is performed, contents of your results container is reloaded – and in your case, the search form is also being reloaded which means it loses the JS events handling the search itself.

    So I would recommend to change the results container selector to be a CSS selector that only contains your results specifically and nothing else.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)