Forums

[Plugin: Custom Field Taxonomies] min and max not working as expected (10 posts)

  1. topsys
    Member
    Posted 2 years ago #

    Hi,

    I am having a few issues with min and max values, I use WP 2.9.1 and CFT 1.4.

    I have a cf called price and a post with a value of 14. When I use your example of,

    ?price-min=300&price-max=500

    it filters correctly, meaning nothing shows, but if I have a filter like,

    ?price-min=100&price-max=999

    the post shows. This also happens when I have filters like

    ?price-min=0.01&price-max=9.99
    ?price=0
    ?price-max=9

    but not when I have one like,

    ?price-min=15.01

    Am I missing something, because I would expect it not to show the post when not in range.

    I thank you in advance for your help and should you need an url where you can see my example, please mail me at topsys[at]gmail.com. I am not posting the link here as I do not want a search engine to find it, since it is not ready to be indexed.

    Cheers,
    olaf

  2. scribu
    Member
    Posted 2 years ago #

    The issue is at the MySQL level.

    To make this work properly, each "meta taxonomy" would need a checkbox that asks "Does this field have only numeric values?"

    I'll add said checkbox when I have a bit of free time.

  3. topsys
    Member
    Posted 2 years ago #

    Hi Scribu,

    thank you very much for you quick reply and thank you very much for your awesome plugin.

    I will be looking forward to this update.

    Cheers,
    olaf

  4. yofx
    Member
    Posted 2 years ago #

    I'm not sure if I have the same problem or not, but it does sound similar to what I'm experiencing. My key is named rating and I have one result with value of 9.5.

    If I do this, it works fine
    ?rating-min=6.5&rating-max=9.9

    But when I do this, I get no results
    ?rating-min=6.5&rating-max=10

    Obviously, if 9.5 was found with the max set at 9.9 it should also be found with a 10 max.

    Thanks.

  5. yofx
    Member
    Posted 2 years ago #

    I tried this in both 1.4 and the 1.5b versions.

    In the meantime, this seems to work...

    ?rating-min=6.5&rating-max=9.9&rating=10

  6. scribu
    Member
    Posted 2 years ago #

    In 1.5b, you have to check the Numeric column for the 'rating' taxonomy.

  7. yofx
    Member
    Posted 2 years ago #

    I did that, but it still doesn't seem to work. The only other setting I changed was I check Allow key=value1+value2 (value1 AND value2) queries
    Note: A '+' in the URL is equivalent to a space!

    You can try for yourself on my site.

    Works
    http://waytooindie.com/?rating-min=6.5&rating-max=9.9

    Doesn't work but should
    http://waytooindie.com/?rating-min=6.5&rating-max=10

    Am I doing something wrong?

  8. yofx
    Member
    Posted 2 years ago #

    Also, I did notice that when I first check the box Numeric, when I hit save it automatically unchecked it when I saved it. But when I clicked the checkbox again, it looked like it saved it.

    Is this an issue with having 1.4 installed first? I did completely remove the old 1.4 folder before installing the 1.5b.

  9. scribu
    Member
    Posted 2 years ago #

    Try deleting the taxonomy and recreating it again and then see if the numeric checkbox behaves properly.

  10. yofx
    Member
    Posted 2 years ago #

    I completely deactivated it and deleted the files from the plugin's folder. Then re-put all the files for 1.5b back in and when I went to Add in a taxonomy it was all pre-filled in with my previous settings. It must be saved in the database or something. But I deleted that taxonomy and re-entered the info. Still no luck.

Topic Closed

This topic has been closed to new replies.

About this Topic