Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to add parameters to user search?
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 5 months ago.
- AuthorPosts
- October 7, 2018 at 5:14 pm #19421
Freunde.one is a network for people with same leisure activities. Therefore, we need a search mask with some parameters in the search mask like “gender” / “city” / and so on. I’ve created the Ajax Search “User” with ID5 and tried my best but I failed.
Please find attached two screenshots. One is from the UltimateMembers settings, to show you, that the meta key “gender” (German: Geschlecht) exists. The other one is the “custom field” => “add new item” form where I’d like to add a drop down for gender. The relevant custom field is not found.
Thanks a lot and kind regards,
Peter
Attachments:
You must be logged in to view attached files.October 8, 2018 at 10:49 am #19427Hi Peter,
The reason why it is not working is, that filtering by user meta fields is not possible – as users are not stored as custom post types. The taxonomy, custom field, and post type filters will only work with custom post types
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 8, 2018 at 11:19 am #19428Thank you for the fast reply. But: your plugin is able to filter the user meta. It it really powerful! It is just not able to add the search parameter cause “custom field” is a required value.
Example: one of the user meta fields is “um_food”. If I enter “Pizza” in the search field, I get all users who like Pizza. It works already. But if I try to add a custom field to the search query, “um_food” does not appear and therefore I can not create a drop down list where users can select Pizza, Burger, etc.
Best regards,
Peter
Attachments:
You must be logged in to view attached files.October 8, 2018 at 11:42 am #19430Hi Peter!
Thank you for your kind words!
Best,
You can still enter the meta key manually there, even if it does not appear in the drop-down list: https://i.imgur.com/QybjfhK.png
However it will not do anything for sure. Searching by custom field values is possible, but the filter has no effect on the user search query.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 8, 2018 at 12:12 pm #19432Thanks a lot Ernest, it works. There’s just one thing: results are always the same. Always 10 results (but there are 1200 users in the db) and always the same 10 results. I guess, I’ve chosen wrong settings somewhere. checked everything but I can’t find my mistake.
Test page for you
https://www.freunde.one/test-search/Kind regards,
Peter
October 8, 2018 at 12:22 pm #19434Hi Peter,
It is because the filter has no effect on the user results, as I have said before. It will just return results for an empty phrase.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 8, 2018 at 5:06 pm #19445So how can we fix that Ernest?
The main reason to buy the Ajax Search Pro plugin, was the possibility to search for users. The membership plugin Ultimatemember is the leading membership plugin besides BP. Ultimatemember has more than 100.000 customers. Most of these customers might be your customers if you support searching the members directory.
As I sad, the Ajax Search plugin is really powerful and well coded. The ability to search also in custom post types (users / meetings / products / xyz) would make it even more powerful!
What do you think?
Kind regards,
Peter
October 9, 2018 at 9:39 am #19458Hi Peter,
Yes, we know that plugin, and some features had been already integrated in terms of the search feature. Filtering by user meta is on the upcming features list, it is not yet finished. Unfortunately it is not possible to simply integrate it via a few lines of code, both the back-end, the search, the query and the post process classes need to be re-worked in order to execute it correctly.
I will move up this request to a top priority, so we will try to finish it quicker and include it in the upcoming minor release. We have a release scheduled by the end of the next week, maybe a bit sooner.
There is a public upcoming feature tracker, if you want to see what we have planned: https://trello.com/b/BUNOEob3/asp
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.