Forums › Forums › Search & Filter Pro › Problem with filter logic
- This topic has 16 replies, 2 voices, and was last updated 9 years, 3 months ago by
Anonymous.
-
Anonymous(Private) December 14, 2015 at 8:01 pm #32192
Hi again
Here is the beginning of a solution. Maybe not the best but it’s a starting point.When you use multiselect or checkboxes (I use Advanced Custom Fields but I suppose default custom fields behave the same), multiple meta_values are stored like this :
a:3:{i:0;s:5:"name1";i:1;s:5:"name2";i:2;s:5:"name3";}
The way I understand this, a counts the number of lines, i is the index, and s counts the number of letters in the value label.Let’s say S&F offers a new option besides AND and OR operators (though you can’t really call this an operator): “Posts with multiple values for the same key must have each of those values in the options selected.
When submitting the form, test each selected option. Count 1 for a positive test. Add 1 for each valid option.
Then compare the result to the number of lines for this meta_key.
If result = number of lines, show this post,
else don’t show this post.How does that sound? It works on paper. ^^
Ross Moderator(Private) December 15, 2015 at 11:49 am #32228Hey Julien
Yup I follow the logic here its just a little more complex because S&F uses its own caching system too combined with WP_Query – so its a bit about implementation, and also how to provide this as an option to a user (which is clear and easy to understand).
I’ll have to have a further look to see if its possible to add in – just busy working on the next update at the moment and this requires me to do some serious debugging around the code.
Thanks
Anonymous(Private) February 1, 2016 at 8:02 am #35876Dear Ross
I hope you’re all good.
I dare a short message to try and see if there is any plan for the request I made. For now, I can’t use the plugin, but I hope you will find time and interest to create this. I’ll be more than glad to help you in any way I could.
ThanksPS : btw, I can’t update to latest version (2.1.2). I keep getting “Download failed. Unauthorized” messages.
Ross Moderator(Private) February 3, 2016 at 9:53 pm #36188Hey Julien
Can you try disable & re-activate your license and the plugin update again?
RE the updates, I’m afraid I didn’t quite get anywhere with them just yet – there are a few large features at the top of my priority list which are just taking a lot longer for me to get round to.
Thanks
Anonymous(Private) February 5, 2016 at 12:15 pm #36314Hi Ross
Disabling and reactivating the licence didn’t work.An error occurred while updating Search & Filter Pro: Download failed. Unauthorized
Regarding the feature request, I understand. If you don’t mind, I will contact you from time to time to know if you think you might have time to work on it. Maybe I could be of some help.
Regards -
AuthorPosts