Forums › Forums › Search & Filter Pro › Conditional Logic
Tagged: Conditional logic
- This topic has 11 replies, 3 voices, and was last updated 8 years, 8 months ago by Ross.
-
Trevor(Private) March 23, 2016 at 7:31 am #40324
Hi
I am hoping this answer is right (Ross may chime in to confirm).
The first thing is that the search form needs to be on the results page, and this (I think) means that you must be using (and the theme must be capable of being used with) the shortcode ‘Display results’ method.
You would need to set the form to update as the user makes selections (General Settings Tab -> Auto Submit Form to checked [on]).
Then, in the search form, in each element where there are likely to be options for the user to choose, make sure that ‘Hide Empty’ is checked [on].
It may also help, on the Display Results settings tab, to have ‘Load results using Ajax’ checked [on], IF your theme supports it (it will be obvious when the user interacts with the form, the results will fade and reappear.
Trevor
Anonymous(Private) March 23, 2016 at 2:27 pm #40377Hmm… Here’s an example, but I was hoping to do this with dropdowns. Notice how when you click an icon, it shows more examples based on that:
http://www.wine.com/v6/aboutwine/pairingfoodwithwine.aspx?s=foodandwine&cid=foodandwine&state=CAAny recommendations on how to approach something like that?
Ross Moderator(Private) March 23, 2016 at 6:00 pm #40398Hey Peter
Something like that won’t work out of the box, but if you are knowledgeable with jQuery you could pull something similar off.. with a few tweaks.
I’ll describe the general logic:
1) You want to get your fields to react / update depending on the selection of another field. This is already possible – check the movies demo, and how how updating genre / film certificate updates the other field automatically – http://demo.designsandcode.com/sfpro-movie-reviews/
To achieve this, make sure you enable
auto count
(in the settings box – general tab) and make sure you enablehide empty
inside your fields2) This is the custom jQuery code you would have to write – but the logic is really not that complex:
– hide all fields with CSS except the first field
– with jQuery, check whenever an input field is updated – or if using ajax, simply check when an ajax request has completed (check first question here)
– now you detect all changes in the fields, whenever there is a change, you would simply check to see if something has been set in the first field, if so, show the next field, if not hide the next field, and so on..Hope that helps anyway! 🙂
Ross Moderator(Private) March 23, 2016 at 6:27 pm #40403Hey Peter
Thanks but I’m afraid the workload with S&F plugin is at an all time high – which means no taking on new projects I’m afraid 🙁
Thanks
-
AuthorPosts