Custom field data is not displayed in search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Custom field data is not displayed in search

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #39914
    sbwestring
    sbwestring
    Participant

    Hello, I have some trouble with advanced custom fields not showing the data in the search results.
    Basically I want to use the plugin for searching for staff members. I order to easily translate the fields with WPML, I have two custom fields i want to use:
    team_phone and team_email.

    I use Avada theme, and the staff members are added as FAQ items (as a workaround).

    You can have a look at Alexander here where i have added data for phone and email fields. They display fine on the frontend, but in the search bar the field display as “Your content goes here”.

    Hope you can have a look, thanks.

    Attachments:
    You must be logged in to view attached files.
    #39932
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for the details, it helps us a lot!

    This is a very intereting issue. I logged in and tried a few different things, and it turns out when the plugin requests the post content, this text is actually returned. I have made a few changes too to see if using different methods would work, but every single time this is returned as the actual post content.

    My guess is, that the fusion builder may work differently during the actual page request and within the ajax request. To save resources developers tend not to initialize parts of their plugins during XHR requests (to make it faster), and I believe this is exactly what is happening here. Basically some parts of the fusion builder are not hooked up, so it does not execute the content filters and simply the default text is returned when requested.

    I tried to look up their documentation if there is any way to explicitly force the page builder to initialize as in normal requests, but I found nothing. I also looked up all option, no luck either. I am almost certain this is a bug in their plugin, I highly doubt this was intended to work this way.

    My best advice here is to use the advanced title and content fields feature. That allows you adding custom fields contents to the live results list, so you can replicate the fusion builder output to some extent.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39934
    sbwestring
    sbwestring
    Participant

    Thanks for the reply and looking into it. It works perfect now with the content fields solution you linked to.
    I have another question now, is it possible to remove the link on the search result? All the info the user need for the employee is displayed in the search bar, so there’s no need to link to the employee page.

    Thanks.

    #39936
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Sure – the best way to do that is via a custom code:

    .asp_r .item,
    .asp_r .item a {
        pointer-events: none;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39939
    sbwestring
    sbwestring
    Participant

    That works great, thank you.

    I have a problem with the search results now. I’ve attached some screenshots, the problem is this:

    1. I’ve made the design like this: search bar on left, and empty results box on right.
    2. Searching for someone, the results display in the right box.
    3. Now the problem is, if i delete what I just searched for, 3 random results will appear in the results box. How can I get rid of this, I just want it to be empty like on step 1.

    Attachments:
    You must be logged in to view attached files.
    #39943
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You can change that by increasing the number of characters to trigger the search to 1 or more here: https://i.imgur.com/OwFLavM.png
    That will do the trick.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39944
    sbwestring
    sbwestring
    Participant

    That did it, perfect, thank you!

    #39945
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.