Forums Forums Search & Filter Pro Conditional Logic

Viewing 10 posts - 1 through 10 (of 15 total)
  • Anonymous
    #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
    Vernita

    Trevor
    #135091

    True 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
    #135195
    This reply has been marked as private.
    Trevor
    #135461

    Can you first try setting that shortcode in a PHP do_shortcode function , like this:

    <?php do_shortcode('[pods name="advertisement" template="search"]'); ?>
    
    Anonymous
    #135469

    Ok 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
    #135471

    Mmm. That means Pods must be using javascript to expand the shortcode. Is the content merely data from pods custom fields/taxonomies?

    Anonymous
    #135473

    Yes that is right, data from custom fields and taxonomies. I am happy to give you access to have a look?

    Trevor
    #135476

    Then if you are using our results.php, you can use php to print out the values individually:

    https://pods.io/docs/code/pods/field/

    https://codex.wordpress.org/Function_Reference/the_terms

    Anonymous
    #135478

    I 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.

    Trevor
    #135483

    The ease by which you achieve the ‘look’ depends on the theme and Custom fields/taxonomies plugins you use.

    How far did you follow the results.php customisation guide?

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

Viewing 10 posts - 1 through 10 (of 15 total)