AnonymousInactive
I’d like to add conditional logic to the filter on this page: https://calvarytyler.org/sermons/
In short, I’d like the “Chapter” field to only work if a “Book / Series” has been selected.
Here’s what I did to try to make that happen:
(1) I went to General —> Enable Auto Count and checked both boxes.
(2) I went to Search Form UI —> Tag and checked “Hide empty terms?”
But that didn’t produce the intended result.
Would you mind helping me? Thank you!
I will take the second question first. I assume that the form is added in the Appearance -> Widgets page, in to a WooCommerce sidebar widget area?
You need to use a widget control/options/logic plugin to restrict which pages the form appears on, such as this on:
https://wordpress.org/plugins/widget-logic/
There many other like this. They would use conditional tags, such as described here:
https://docs.woocommerce.com/document/conditional-tags/
The styling on the other form is quite extensive and custom. This would be outside the scope of our support, sorry. You would need to hire a third party coder to help you with this.
AnonymousInactive
Hello
yes I’ve implemented it this way, it’s still on work but it basically works.
To my experience, multiples forms still work as long as only one form, the one sending the date to the others display value in url.
V3 sounds nice, spliting the form could be cool, as well as some conditional logic to display field (based on url, field value, etc.)
regards
AnonymousInactive
Thanks for the quick reply, Trevor.
Unfortunately, the site is not live yet. I solved my problem by adding some conditional redirects to the init
hook which act like rewrite rules.
I was hoping to apply the logic via filters but the plugin does not seem to offer suitable ones nor does it seem to modify the tax or meta queries, at least as far as I can tell. I started digging into the code but got lost in the cache mechanism. 🙂
Overall, it’s a good plugin that got me 95% there.
Cheers,
Chris
AnonymousInactive
Hello,
I have a similar (or the same) issue like described in “Using ACF select field for dropdown (label/value issue)” (https://support.searchandfilter.com/forums/topic/using-acf-select-field-for-dropdown-labelvalue-issue/).
I am using Search & Filter Pro, ACF Pro, CPT UI, Beaver Themer and Beaver Builder to create a Beaver Themer Layout Archive to display a resource list with some filters.
For that I created some custom fields with ACF Pro where I only specified labels (not values) for the Choices (for example for a checkbox). That worked and the filter displayed the labels like I wanted.
Then I changed the Choices of the custom fields by specifying both the values and the labels. So I added the values (e.g. red : Red).
Now, after that I have the problem, that the filter are not displaying the labels anymore but the values when I open them in an incognito window.
It’s also weird that when I check the filter via the Beaver Builder preview mode, that only the filters with Conditional Logic are displaying the values and the others are displaying their labels.
I also like to add that I changed the naming of some custom fields in this process and reconnected them etc., but for me that looks fine and the filtering itself works right.
Can somebody look into it?
AnonymousInactive
Hi,
Saw a few posts about using conditional logic with the filters but they seem to contradict each other. Once post from last week gave an example of 3 dropdowns with the values of the last two conditional on the previous value, starting from the first. You provided a recommendation that worked for the developer and I started down that path, but realized there’s a few ways to accomplish this so I thought I’d check to see if there were any other posts with the same request. I found one from March where you mentioned that for now, the current version of the plugin doesn’t support conditional logic, but the next version (3.x) might. I’m running 2.51 and don’t see any updates…hence my confusion. Did the first developer create his own CSS/JS logic or is he using a newer version of the plugin?
Thanks!
AnonymousInactive
Thanks Trevor, I understand the logic here, but it doesnt appear to be working – potentially because I am using the AJAX to return the results, rather than a page refresh.
essetnially by wrapping the default category loop code with your conditional logic, it always says “nothing to see here folks”.
any clues?
I assume, from what you say, that these fields are hidden on page load, and appear only after an Ajax reload of the results (after a filter)?
I also assume that, if you disable Ajax in our form, that all works OK, except you don’t want/need the page to reload?
How are you hiding the conditional logic fields? Are you using JavaScript? If so, you need to add a script to trigger that script again, using our AjaxFinish event, which you can see detailed here:
https://searchandfilter.com/documentation/faq/
It might look something like this:
<script>(function ( $ ) {
"use strict";
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
// call your script or function here
});
}(jQuery));</script>
AnonymousInactive
I am using elementor pro, and ACF some of the fields in ACF are set to show conditionally. if i load results using ajax all the conditional logic fields that should be hidden show. This only happens after setting any type of filter and continues until the page is refreshed.
Regards
Dave L
AnonymousInactive
Hi, thanks for taking a sec.
How can I configure this so sub categories (children) of a taxonomy appear only when it’s parent (same taxonomy) is checked?
i.e. parent checkbox = hand wear. When checked, two boxes appear for gloves and mittens (but are hidden unless hand wear is checked)
thank you!