Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ross Morsali

    (@designsandcode)

    Hey CrioSciento, did you check out the pro version of our plugin yet?

    http://demo.designsandcode.com/searchandfilterpro/product-search/

    This does exactly what you need…

    Also see this forum post, maybe you don’t need Ajax and are happy with a page refresh 🙂

    http://wordpress.org/support/topic/auto-submit-on-select?replies=4

    Thread Starter CroiSciento

    (@croisciento)

    Thanks this is working.

    One last thing, is it possible to apply a css on all parent terms/child terms? So even If I add new terms they’ll be automatically stylized.

    Plugin Author Ross Morsali

    (@designsandcode)

    Yeah you can…

    Depends on what you are using

    If you are using checkboxes/radio then children are wrapped in a UL so you would do something like:

    .searchandfilter ul li ul li
    {
        /* these are child list items */
        background-color:#cc0000;
    }

    If you are using select/multiselect, there are depth classes added to each option to determine if an item is a child ,so you should be able to target these (something like “depth-1”, “depth-2” etc, depending on hierarchy structure).

    Thread Starter CroiSciento

    (@croisciento)

    Okay thanks. 🙂

    Seeing as this post is so recent and I’m aiming to achieve the same thing, forgive me for kidnapping the thread.

    I’ve created a child theme to allow for customisation of taxonomies. This is working great.
    I’ve added a enqueue_script into my functions.php in the child theme to call for the JS outlined above:

    // Refresh the search in directory after picking one of the criteria
    
    if ( !is_admin() ) { // instruction to only load if it is not the admin area
       // register your script location, dependencies and version
    	wp_register_script('refresh_script', get_stylesheet_directory_uri() . 'js/refresh.js', array('jquery'), true );
    
       // enqueue the script
       wp_enqueue_script('refresh_script');
    }

    my refresh.js file code is as follows:

    $(".searchandfilter select").change(function() {
       $(".searchandfilter").submit();
    });

    The website I’m trying to implement it on is http://www.cambridgesca.org.uk/ExternalDirectory/searchdirectory/
    Sometimes, when I’m switching between the items on the drop-down list, it looks like there’s some activity on the windows-program-bar (not sure what its official name is!); like there was a pop-up new window trying to come up.

    I would appreciate if you could point me in the right direction to achieving multi-criteria search as demonstrated in the add-on that the OP linked.
    We are a charity, so if we can get away without paying for add-ons, it would be wonderful.

    On a side-note, today (it’s something I’ve been fighting with yesterday), when I’m trying to open/edit refresh.js through FTP, I get error that says Object Expected, 800A138F, Microsoft JScript runtime error.
    I had another look on your pro-version demo site just now, and on the side bar I get the following error:

    Fatal error: Call to undefined function array_replace() in /var/sites/d/demo.designsandcode.com/public_html/searchandfilterpro/wp-content/plugins/search-filter-pro/public/includes/class-search-filter-display-shortcode.php on line 411

    I did an Adobe Flash Player update this morning – can the errors be related to that…?

    Thank you for your time

    Plugin Author Ross Morsali

    (@designsandcode)

    Hey cambridgesca, this is a problem I discovered not so long ago with PHP 5.3 users and below… basically there is a function that does not exist…

    Add this to your functions.php file and it should work –

    if (!function_exists('array_replace'))
    {
    	function array_replace()
    	{
    		$array=array();
    		$n=func_num_args();
    		while ($n-- >0)
    		{
    			$array+=func_get_arg($n);
    		}
    		return $array;
    	}
    }

    I will include this in the next update

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Filtering without submit button?’ is closed to new replies.