Forums › Forums › Search & Filter Pro › Selected more than one checkbox error
- This topic has 20 replies, 2 voices, and was last updated 10 years, 9 months ago by
Anonymous.
-
Anonymous(Private) April 24, 2015 at 4:36 am #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=ArizonaDOESN’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,+OahuRoss Moderator(Private) April 24, 2015 at 9:36 am #15788Hi 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(Private) April 24, 2015 at 12:43 pm #15816Hi 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,
IanRoss Moderator(Private) May 1, 2015 at 11:58 pm #16445Hey Ian
Do you have a link I could look at?
Thanks
Anonymous(Private) May 2, 2015 at 12:20 am #16451Hi 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.
<?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(); ?> -
AuthorPosts