Multiple Values for an Item
-
Hey, thanks for this great plugin. I am trying to do a few things that I am pretty sure are possible with this plugin I just need some help to get there.
1. I want an item to have multiple values. For example, I have four options for where a business works: Place 1, Place 2 and Place 3, Place 1,2 and 3.
In my Select Menu I want to have four options:
All – Shows all the Businesses
Place 1 – Shows all the values with Place 1 plus the last option of Place 1,2 and 3
Place 2 – Shows all the values with Place 2 plus the last option of Place 1,2 and 32. The next thing I want to do is kind of combine three select menus in one so the format is like this:
All of Location 1
Location 1-a
Location 1 – b
Location 1 – c
All of Location 2
Location 2 -a
Location 2 -b
Location 2 -cI can generate the select menu fine it is just displaying the ‘All of Location 1’ etc. that is giving me problems.
Do you have any idea how to do these two thing?
Thanks,
Jakehttp://wordpress.org/extend/plugins/advance-wp-query-search-filter/
-
I will not recommend to edit the plugin. Why don’t you use my new Ajax WP Query Search Filter to do it. It got filter for you to customize the plugin.
Ok so using your new plugin would I do something like this to add multiple values?
add_filter(‘ajax_wpqsf_query’, ‘add_values’);
function add_values($args){
$args[‘meta_query’][‘value’] = array(‘location1’, ‘location2’, ‘location3’);
return $args;
}Also with the new plugin do the results automatically use search.php as the template?
Thanks,
JakeBasically there are various filters for the form input, depends on what is the display type (button, checkbox or dropdown) and what are the source (meta field, or taxonomy). Can’t tell what you want to use.
Where are all the filters listed?
And which filter would I use for a dropdown and meta field?
Thanks,
JakeI ended up doing what I wanted by editing the process.php file, thanks for the help. If anyone is trying to do the same thing this is what I did:
I just added elseif statement’s to the meta for each loop as I needed
elseif($v['value'] == 'Value of key you want to add multiple values to'){ $cmf[] = array( 'key' => strip_tags( stripslashes($v['metakey'])), 'value' => array('value1', 'value2', 'value3'), 'compare' => 'IN' ); }
Basically just add as many elseif statements for values that you need to modify.
Jake
- The topic ‘Multiple Values for an Item’ is closed to new replies.