Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Not filtering – custom query option

Viewing 10 posts - 1 through 10 (of 10 total)
  • Brian
    #238406

    Hi –
    I just purchased and haven’t been able to get it working yet. Filter is for a custom post type which I’v selected. I added my taxonomy terms as checkboxes. For Display I chose the custom option – because the theme I’m using has a custom wpbakery module to query / display custom post type on page. I tried the custom option:

    $args = array(‘post_type’ => ‘tour-date’);
    $args[‘search_filter_id’] = 98;
    $query = new WP_Query($args);

    And added the correct url to page. My filter fields show up with shortcode. But when I try to filter the page – the ajax runs but never filters anything. I even tried turning off the ajax option but it did not filter.

    How can I get it working / thoughts?

    Thanks in advance!

    Trevor Moderator
    #238410

    Where did you enter these arguments? In the custom module settings?

    Maybe, instead, add a shortcode or text module before the post module, with this shortcode:

    [searchandfilter id="98" action="filter_next_query"]

    That MIGHT work.

    Brian
    #238507
    This reply has been marked as private.
    Trevor Moderator
    #238513
    This reply has been marked as private.
    Brian
    #238532
    This reply has been marked as private.
    Brian
    #238538
    This reply has been marked as private.
    Trevor Moderator
    #238540

    The ‘No Results Found’ type of message comes from the theme or Page Builder, and not our plugin. In the case of the module you are using from Page Builder, they are not often built in to the code, unfortunately.

    If the form does not have a text search box, then you can minimize the risk of needing it by following the steps in this post:

    https://support.searchandfilter.com/forums/topic/adding-product-tag-search/#post-236003

    Is it OK to close this thread for now?

    Brian
    #238681
    This reply has been marked as private.
    Brian
    #238685

    Hi Trevor,
    I reached out to plugin author and they provided the below and it’s working now. Thanks and you can close this ticket!

    add_action('wp_footer', function() {
    	?>
    	<script>
    		jQuery(document).ready(function($) {
    			$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    				console.log("ajax complete");
    				$("[class*=bne-panel-trigger-]:not(.trigger-page-link)").each( function( i, obj ) {
    					$(this).on('click', function(e) {
    						e.preventDefault();
    						var panelId = $(this).prop('class').match(/bne-panel-trigger-([0-9]+)/)[1];
    						BNEPanelTrigger( 'open', panelId );
    					});
    				});
    			});	
    		});
    	</script>
    	<?php
    }, 99);
    Trevor Moderator
    #238700

    Thanks for sharing. I will close this thread for now.

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

The topic ‘Not filtering – custom query option’ is closed to new replies.