Forums › Forums › Search & Filter Pro › Conditional Logic
Tagged: Conditional logic, gravity form, pods, taxonomy
- This topic has 14 replies, 2 voices, and was last updated 7 years, 2 months ago by Trevor.
-
Anonymous(Private) October 5, 2017 at 7:15 pm #134995
Hi
I need the search to display taxonomies according to conditional logic:
It should have a dropdown with “All Provinces” > Then as the Province is selected, the Towns in that Province appear for users to select for the search.
Is that possible? When searching in your forums I found this:
“This would be called a conditional search. At this time, our plugin does not offer that feature, but it is something we are looking at for V3, but that is still some months away yet.”I assume that means it is not possible yet?
If so I am afraid I will have to ask for a refund as I really need that feature. Or do you know of an alternative approach? Maybe there is a way to use the search function in a form created by Gravity Forms? I am working with Pods and created the taxonomies with Pods. They get populated with data collected with Gravity Forms – not sure if any of that matters?
Many Thanks
VernitaTrevor(Private) October 6, 2017 at 10:46 am #135091True conditional logic is not an advertised feature of our plugin. However, it does support Quasi conditional logic, which is what most sites use.
Let me take the example of your two taxonomies (they must be two separate taxonomies, and not one taxonomy with multiple parent/child relationships – if you have done this, it can easily be changed into two taxonomies); Provinces and Towns.
When the page with the form opens, both fields would be visible, populated with all possible variations of terms.
When the user makes a selection in the Province field, the Town field updates to show only the towns in that province. Also, if the user selects a town first, the Province field would update to show the correct province.
This is done by:
1. Enabling (ON) the two Auto Count settings in the General Settings tab, and
2. On each field, set Hide Empty to ON.We do it this way because WordPress does not maintain referential data integrity in its database, which is what is required for True Conditional Logic (although it can be faked). Instead the ‘joins’ are in each post where you select terms for each field and thus create the ‘link’.
Anonymous(Private) October 9, 2017 at 10:30 am #135469Ok I’ve made the change as you suggested but now we are back at only showing the title in the result instead of the image, name and location too. https://skillscoach.co.za/search-page/
Trevor(Private) October 9, 2017 at 11:03 am #135476Then if you are using our results.php, you can use php to print out the values individually:
Anonymous(Private) October 9, 2017 at 11:11 am #135478I tried that and I just could not get it to work – my knowledge of php is very limited, that’s why someone in Pods’ slack channel suggested using the shortcode. I didn’t realise it was going to be so complicated to get the same result you get in your demo video.
-
AuthorPosts