Search & Filter Pro Bricks Integration Plugin

Hey all!

Just letting you all know I released a fix for this bug. Feel free to get the latest version from my github.

1 Like

Hey @cmstew! I’m researching “search & filter facets” plugin options. I’d like to avoid a paid plugin, my idea is to use the Integrated bricks S&F once it’s built (it’s on the roadmap!).

I’m curious, What allowed for S&F Pro ver. to be implemented versus the free version? What needs to be done to get the free ver. setup?

Cheers, Blake

Hey Blake,

Thanks for your interest in the S&F Bricks extension. The main reason is that the Free & Pro versions of the plugin are vastly different. They are built completely differently and seeing as I had the Pro version, that is the one that I spent my time integrating.

I thought of working on the free integration too but since I don’t use the free version and v3 (a complete rewrite of S&F) is supposed to be coming out SOON™, I didn’t want to waste my time working on the free version. I might consider building a free integration after v3 is released, whenever that may be.

1 Like

Hey @cmstew I implemented S&F Pro using your hotfix plugin. Everything works but the ajax loading, the bricksLazyLoad bug fix in 1.1 doesn’t seem to be getting called.

–Disabling Bricks Lazy Load in settings works fine
–Code Element with your provided code works fine

EDIT: More importantly! : Post Loop builders in alternate pages (where search and filter is not being used) are now broken. see edit 03 below.

Dynamic Data does not work. Issue is tied in with “stu-search-filters-bricks” plugin, if deactivated, the Dynamic Data works. See images below

Edit 02: Perhaps Enqueuing Plugin ONLY on specific pages could work as fix?

image

Edit 03: SAFE FIX? I commented out line 147, “wp_reset_postdata();” in stu-search-filter-bricks.php. Not sure what the line exactly does, but dynamic data on other pages are working now.

	// Method to get an array of Search & Filter Forms
	public static function get_search_form_options() {

		$custom_posts = new WP_Query('post_type=search-filter-widget&post_status=publish&posts_per_page=-1');

		$search_form_options = [];
		foreach($custom_posts->posts as $post){
			$search_form_options[$post->ID] = get_the_title($post->ID);
		}

		//wp_reset_postdata();

		return $search_form_options;
	}

Hey Blake,

Glad you got it working. In order for Ajax to work, you need to follow the instructions very carefully. Please take a look at some of my previous replies where I go into detail about how it all works. This being one of them.

I’m unsure what you mean because I made sure it worked before I merged the update. If you can provide login credentials for me to look or steps on how to reproduce the issue, I can take a look.

I have not experienced this. If you could provide steps to reproduce, I’ll see about fixing it.

Dynamic data seems to work fine for me. I’m glad you found a solution though. I’m not sure it’s one I would recommend but my understanding of wp_reset_postdata() is a little foggy so maybe it’s unnecessary. However, from my understanding it’s supposed to be called if you plan on running a new WP_Query so that you can return the query back to the main loop. If someone has a better understanding of this, I would be happy to learn.

Hey everyone,

I’ve released v1.2 of the plugin with a few bug fixes. Thanks @blakek for helping me find them. :wink:

2 Likes

Hi @cmstew ,

I am in the need of displaying selective posts in a dropdown form (using S&F ?) then post by ajax and show the results through brickbuilder elements, so i am VERY enthousiastic about this topic.
My question; the content values i want to show are ACF fields (to be more precise; thy are repeater fields of a listing). Is that possible?

Jasper

Hey Joep,

From my understanding, repeater fields are not currently supported by S&F Pro.

Hi,

Thanks for the message. I managed to work it out with WPGridBuilder (which was installed anyway) and this tutorial: Using WPGridBuilder Facets with Bricks' Query Loop - BricksLabs

Jasper

1 Like

Dude, what an absolute legend. Thank you!

Brick’s built-in filter is far too simple to be useful for anything but the most basic use-case, I really hope they improve it to include at least custom fields / post-meta. Until then I’ll be using S&F with this.

1 Like

Can’t make S&F and Bricks to works together. With a shortcode or with the integration plugin.
I have set an id for the container wrapper of the query. Disabling Ajax doesn’t change anything. Disabling the native Bricks filter expriment neither. Is it just on my end or anybody as the same issue with latest Bricks and S&F ?

Haven’t tried yet with the plugin but telling this here as it coud help others. I have S&F working with shortcode in Bricks with the settings set as stated here but an additional code is needed.
I added

add_filter( 'bricks/posts/query_vars', function( $query_vars, $settings, $element_id ) {
  if ( in_array('post',$query_vars['post_type']) ) {
		$query_vars['search_filter_id'] = '410';
	}
    return $query_vars;
}, 10, 3 );

And now I get filters working.
You have to change the id by the search form Id you wish to use and customize the ‘post’ value for post_type if needed.

1 Like

Confirming this worked for me. Changed ‘post’ to my CPT name and ‘410’ to my query ID in S&F Pro.

I tried Filter Everything Pro and after changing the post type (on request of client) and redoing the entire listing within my CPT with brand new fields to avoid conflicts, it still wouldn’t populate correctly. It did work before the CPT change. S&F can regenerate the cache when requested and has no trouble detecting the new fields. The Bricks Builder filters will be great when they’re out of beta but for the interim, this works. Bricks Builder also found the new fields. The issue appears to be isolated to Filter Everything Pro. I did reach out to the developer but he wasn’t much help aside from pointing me to a “known issues” page.