Forums Forums Search & Filter Pro Selected more than one checkbox error

Viewing 10 posts - 1 through 10 (of 21 total)
  • Anonymous
    #15772

    I created a few custom checkboxes with ACP to use on a custom post type. In my case the user can select what areas were associated with the project. I built the search form – matched up the fields and it’s working – sort of.

    I have an advanced search page on the site where the user can search for project locations. All is working fine if the user selects the locations that the user has set in the backend in a post. But if the user selects one item on the advanced search page that is not checked in the backend the search returns zero results.

    I want the search to work for any posts that have ANY of the check boxes marked – Not ALL of the checkboxes marked.

    Sample URL after a search is performed:
    WORKS
    http://websiteurl.dev/?sfid=86&_sfm_location_western_region=Arizona

    DOESN’T WORK – returns no results, even though a project has been checked as listed in Arizona
    http://websiteurl.dev/?sfid=86&_sfm_location_western_region=Arizona&_sfm_location_pacific_region=Hawaii,+Oahu

    Ross Moderator
    #15788

    Hi Ian

    In the admin, under your “Post meta” field, you have an option “search operator” – changing this to “OR” should do what you want.

    Just to let you know support is now closed until Thursday as I’m actually away (check the notification at the top of this page & the support forums).

    As an FYI (although it sounds like it doesn’t apply in your case), there is a recently discovered bug which occurs with meta fields which I hope to get a fix for pushed next weekend.

    Thanks

    Anonymous
    #15816

    Hi Ross.

    Firstly, enjoy the time off. I don’t expect a response on this while you are closed.

    I did make sure all the post meta search operators were set to “OR”. I double checked them all again and the problem still persists.

    I’ll check back next week hopefully for a fix.

    Cheers,
    Ian

    Ross Moderator
    #16445

    Hey Ian

    Do you have a link I could look at?

    Thanks

    Anonymous
    #16451

    Hi Ross,

    It’s all in local development right now but here’s a screenshot of the search form (it’s huge! – maybe thats the issue?) and a look at the code that drives it. I’ve checked all the meta fields in the backend and they are all set to OR.

    Advanced Search Screenshot

    Backend Screenshot1

    Backend Checkbox Setup

    <?php
    /*
    Template Name: Advanced Search
    */
    ?>
    
    <!-- Setup The Header -->
    <?php get_header(); ?>
    
    <!-- Load the Content -->
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    	
    	<div class="row">
    	    <div class="column12">
    				
    	    	<h1><?php the_title() ;?></h1>
    	        <?php echo do_shortcode( '[searchandfilter id="86"]' ); ?>
    	    </div>
    	</div>
    	
    <?php endwhile; ?>
    
    <!-- If no content is found -->
    <?php else: ?>
    	<div class="row">
    	    <div class="column12">
    	    	<h2><?php _e('Not Found'); ?></h2>
    	    </div>
    	</div>
    <?php endif; ?>
    
    <!-- Setup Footer -->
    <?php get_footer(); ?>
    Anonymous
    #16616

    Just wondering if you made any progress on this issue?

    Anonymous
    #16946
    This reply has been marked as private.
    Ross Moderator
    #16949
    This reply has been marked as private.
    Anonymous
    #16950
    This reply has been marked as private.
    Anonymous
    #16951
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 21 total)