Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search filters go missing when second added
- This topic has 15 replies, 2 voices, and was last updated 7 years, 8 months ago by
lefthookdigital.
-
AuthorPosts
-
September 15, 2018 at 8:53 pm #19213
lefthookdigital
ParticipantI added a second Custom Field Search Filter just now:
https://cl.ly/c489f66963d3And now the filter options won’t appear on my search form here:
https://lefthookdigital.com/saas/I see several errors in the Inspector that don’t show unless/until I add a second custom field filter choice. See
https://cl.ly/dcfb2476a020You should be able to see the same errors by visiting and inspecting the page, again here:
https://lefthookdigital.com/saas/September 17, 2018 at 10:09 am #19226Ernest Marcinko
KeymasterHi!
The error message is reporting an issue with the DOM node structure, as the plugin tries to move the settings box to it’s correct position.
I have tried to open the page with javascript disabled, and I notied that the checkbox values have a serialized text structure there instead of the vlues, possibly because those are stored differently. Do you happen to use a plugin for checkbox custom field values in the post editor screen? Or are these included with the theme?
I suggest entering these manually instead, as the fields are not stored as a text, but as a serialized array of values instead, which I believe is causing the problem here.
September 17, 2018 at 4:58 pm #19236lefthookdigital
ParticipantYou cannot access this content.
September 17, 2018 at 5:47 pm #19238Ernest Marcinko
KeymasterHi Tom,
That should definitely work in that case as well, since the same code is used to request the field values from ACF – which apparently is not working. There was an issue with the get_field_object(..) ACF function, that was supposedly circumvented in the current search plugin release. Looks like there are still cases where the bypass solution does not work either.
Can you please add temporary FTP and back-end access? I will have to debug this via editing the search files directly to see why the values aren’t returned as they should be.
September 17, 2018 at 6:55 pm #19245lefthookdigital
ParticipantYou cannot access this content.
September 17, 2018 at 9:31 pm #19251Ernest Marcinko
KeymasterThank you!
So, after hours of researching stackoverflow forums, the ACF help forums and other github resources, I managed to find a solution. Seems like, the bypass solution we had was not working, simply some fields were still missing. I have added few additional lines of code, which is now a combined solution of 3 redundant methods, to make sure all of the ACF fields are parsed one way or another. I wish they had a simple function, so many developers have problems with this same exact requirement.
Anyways, please keep a copy of the wp-content/plugins/ajax-search-pro/ folder on your server, as some of the search plugin files were changed (in case you reinstall). I will however include this solution in the upcoming release, so you don’t have to worry about that anymore.
September 18, 2018 at 12:29 am #19260lefthookdigital
ParticipantYou cannot access this content.
September 18, 2018 at 4:53 am #19261Ernest Marcinko
KeymasterHi Tom,
Thank you, I did not actually check the front-end, as I did not want to make changes to the search, I only checked the preview, where it worked – sorry about that.
There was another minor problem, where the ‘<' sign in the label was not properly rendered, and was recognized as a HTML tag, causing the disappearance of the settings box. I have corrected that as well. You should see the filter on the front-end now.
September 18, 2018 at 2:37 pm #19273lefthookdigital
ParticipantYou cannot access this content.
September 18, 2018 at 3:14 pm #19275lefthookdigital
ParticipantYou cannot access this content.
September 19, 2018 at 10:32 am #19293Ernest Marcinko
KeymasterHi!
Thank you for the great review, I really appreciate that.
Well, if you dynamically load the checkboxes like so:
[code]
{get_values}
[/code]…then by default they will be unchecked, and with this:
[code]
{get_values checked}
[/code]then all of them will be checked. For individual values, if there is a double star after the line, then that value is checked, otherwise unchecked:
[code]
unchecked||This box is uncheced
checked||This box is checked**
[/code]Select all option is not yet available, although I am pretty sure that should have been implemented by now. I will make sure to add that feature to the upcoming release.
More details can be found here: Custom field filters documentation
Filter groups
Indeed, that is not possible, at least not yet. However, you can create multiple search instances, all with different configurations. Perhaps, if you need a bit different layout for each dimension, you could possibly make a search bar for each. You can even duplicate the search bars, once you have one up and working, to make things faster.
I don’t think that there is a better solution right now.September 19, 2018 at 2:32 pm #19302lefthookdigital
ParticipantYou cannot access this content.
September 20, 2018 at 9:13 am #19306Ernest Marcinko
KeymasterYou cannot access this content.
September 20, 2018 at 2:42 pm #19323lefthookdigital
ParticipantOk, glad I asked first!
Can you consider adding “filter groups” that can be independently embedded via shortcode?
Alternatively, I have a plugin that allows me to shortcode any php snippets. If you can offer the php to achieve grouped search filters, I’d be willing to give it a try.
Thanks!
Tom
September 20, 2018 at 8:52 pm #19327Ernest Marcinko
KeymasterHi,
I will definitely consider it, sounds like a neat feature.
It is however bit more complicated, as the items are expected to be contained within one single element. The front-end script as well as the stylesheet rules are made for this structure, and making any major change to it will break the search function alltogether. I would rather not recommend making any direct changes to that to be honest. I would suggest a custom code or a minor modification, if this was possible that way, but unfortunately it cannot be done without major code modifications, I am sorry.
-
AuthorPosts
- The topic ‘Search filters go missing when second added’ is closed to new replies.