How to make a ">=" compare dropdown field

Forums › Forums › Search & Filter Pro › How to make a ">=" compare dropdown field

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #22448

    Hi,

    I have a dropdown post meta field with numbers (1 – 5). It will filter an ACF field where a number can be set. The filter works great, if I choose 3, it will show all results that are set to 3. However I want to change the compare to ‘greater then or equal to’ (>=).

    I did try to change rule number 470 in ‘class-search-filter-setup-query.php’ and added there “compare” => “!=” just for testing, however this does not work. I do believe this is where the query is setup, how should I do this properly?

    Thanks!

    Ross Moderator
    #22617

    Hey Lars

    Its not yet possible with the plugin, but I do plan to add this in.

    In terms of changing the plugin code, there are 2 files the query is created depending on your setup.

    If you are displaying your results as an archive, then the above file is correct – however if you are displaying your results using a shortcode (under the “display results” tab) then the correct file is:

    class-search-filter-get-results.php

    Its a bit messy, S&F 2.0 is a lot cleaner and for all display methods the query is created in 1 place – should be out soon.

    Thanks

    Anonymous
    #22783

    Thanks for your response. I did already found out how it’s made. Changing the SQL query to >= did the trick.

    Looking forward to S&F 2.0!

Viewing 3 posts – 1 through 3 (of 3 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.