[Resolved] Complex query from a form submission
I hope this makes sense and I hope someone can help.
Here’s the basic situation:
I have a custom post type with multiple category-style taxonomies.
On the form page where users begin their search, I have a form with multiple fieldsets, each fieldset containing multiple checkboxes (more than one checkbox can be selected for each fieldset). Each fieldset is associated with one of the taxonomies.
A sample form where the user wants to search for a specific Widget:
Fieldset 1 contains the categories from the taxonomy ‘Color’.
Fieldset 2 contains the categories from the taxonomy ‘Size’.
Now, let’s say the user checks the following boxes in the different fieldsets:
Color: ‘Red’, ‘Blue’, ‘Yellow’.
Size: ‘Small’, ‘Large’.
What I would like to accomplish is query the Widget posts and return all the Widgets that are (Red OR Blue OR Yellow) AND (Small OR Large).
This could, in theory, return up to 6 Widgets, those that are:
Red and Small, Red and Large, Blue and Small, Blue and Large, Yellow and Small, Yellow and Large.
Thanks for any help!
- The topic ‘[Resolved] Complex query from a form submission’ is closed to new replies.