This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Search filters go missing when second added

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search filters go missing when second added

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #19213
    lefthookdigitallefthookdigital
    Participant

    I added a second Custom Field Search Filter just now:
    https://cl.ly/c489f66963d3

    And 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/dcfb2476a020

    You should be able to see the same errors by visiting and inspecting the page, again here:
    https://lefthookdigital.com/saas/

    #19226
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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.

    #19236
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19238
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi 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.

    #19245
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19251
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank 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.

    #19260
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19261
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi 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.

    #19273
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19275
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19293
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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.

    #19302
    lefthookdigitallefthookdigital
    Participant

    You cannot access this content.

    #19306
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #19323
    lefthookdigitallefthookdigital
    Participant

    Ok, 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

    #19327
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Search filters go missing when second added’ is closed to new replies.