Custom field filter not working – Chosen jQuery not loaded

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Custom field filter not working – Chosen jQuery not loaded

This topic contains 14 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 2 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #25413
    danielecelsa07
    danielecelsa07
    Participant

    Hi,

    I am implementing a custom field filter but it is not working properly and, when I load the page with the search bar, I get the error that I attach.

    I tried to find a solution going to Ajax search Pro -> Compatibility settings but I don’t find the option that generates the error and what to modify in order to fix it.
    There are many submenus and options, can you please guide me to fix the issue?

    FYI the filter is dynamic, I am using {get_values} to retrieve the data and I show them in a dropdown menu filter.

    Thank you very much,
    Daniele

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

    Hi Danielle,

    Sorry about the inconvenience, this is an issue with the latest release. A bugfix update will be uploaded within a couple of hours addressing this problem – updating to that version will resolve the issue immediately. (4.17.4)

    Best,
    Ernest Marcinko

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


    #25422
    danielecelsa07
    danielecelsa07
    Participant
    You cannot access this content.
    #25425
    danielecelsa07
    danielecelsa07
    Participant
    You cannot access this content.
    #25444
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I just checked, but the upload file is definitely correct. Codecanyon might need some time to process the change I guess.
    Try downloading the file again, via your downloads page, their cache is hopefully updated now: https://codecanyon.net/downloads

    Best,
    Ernest Marcinko

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


    #25450
    danielecelsa07
    danielecelsa07
    Participant

    Hi Ernest,

    thanks, with the new release the error does not appear anymore

    BUT the filter still does not work 🙁

    To let you understand, the search bar searches between taxonomy terms of a taxonomy called Restaurant.
    Each taxonomy term has a custom field required when I create it. I use ACF and I created a group for this taxonomy.
    One of the custom field in this group has the slug ‘_citta’ and it is a Select custom field, where I indicated the possible options: Milano, Napoli, Palermo.
    So when I create a new Restaurant taxonomy term, I have to set the custom field as one of those cities.

    In Ajax custom field filter I used {get_values} to get the possible values (I attach screenshot with configuration, you can see ‘_citta’ as custom field) and it works fine because I see in the search page the dropdown menu that I also attach.

    The problem is that, even if I select one of the cities in the dropdown menu, when I search for a taxonomy term that has another city as custom field, I still see it on the results page! So it seems like the filter is not applied.

    Can you please help me understanding what could be wrong?

    Thanks in advance,
    Daniele

    Attachments:
    You must be logged in to view attached files.
    #25453
    danielecelsa07
    danielecelsa07
    Participant

    In addition, I attach also the configuration for Advanced Frontend search settings.

    Thanks,
    Daniele

    Attachments:
    You must be logged in to view attached files.
    #25456
    danielecelsa07
    danielecelsa07
    Participant

    Hi Ernest,

    I add one more thing.
    It seems that the Index Engine Table (and consequentially – I guess – the custom field filter) does not refresh in the proper way.
    If I create some new custom field with ACF, I do not find them in Index Table nor in custom field filter.. but, I still see some custom fields that I put in the trash…I don’t even see some other…
    Is there a way to refresh the Index Engine, in order to make it ‘see’ the last changes?

    I also tried to clean the cache but it seems stuck in ‘Loading’, as you can see in the attachment.

    I ask you on this topic because I think that maybe the filter is not working properly for this reason.

    Thanks,
    Daniele

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

    Hi Danielle,

    If I understand correctly, you want to use the custom field filter to filter a taxonomy term result? I’m asking, because that is not possible. The custom field filters apply to custom post type results (or user results), but not to taxonomy results.

    The custom field selector on the index table queries the post_meta database each time to get the custom fields. If you don’t see a cutom field in the list, that means, that there is no post yet, that contains that custom field with a value. Once you add a post or change a post, with that custom field set, it will start appearing.
    If you also see fields that you have deleted, then the deletion may not changed the existing fields for existing posts. They still exist in the post_meta table, thus they still can be used for filtering

    Best,
    Ernest Marcinko

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


    #25469
    danielecelsa07
    danielecelsa07
    Participant

    Hi Ernest,

    thanks for your reply.

    So, is there a way to filter taxonomy terms results?

    I tried filtering by parent term in a hierarchical taxonomy but it did not work, so the only other option that I saw was to add a custom field to the taxonomy terms and filter by custom field…But I got it is not possible.

    FYI, when I tried filtering by parent terms this is what I did:
    The taxonomy Restaurant was hierarchical. The parent were cities, and the children were the actual restaurants.
    I filtered by Taxonomy filter, using a dropdown menu where I show only the parent tems. But once I choose one, the search is not affected by the choice.

    The same approach worked when I filtered a CPT result (not a taxonomy term like I am trying now) with a hierarchical taxonomy associated. I filtered by the parent terms and I searched in search bar for the children terms, and as a result I got the CPT with associated the taxonomy term searched, filtered by the father.

    Hope you can give me a suggestion for filtering taxonomy terms.

    Thank you!

    #25476
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I”m afraid there is no way at the moment. The filters are explicitly programmed for filtering custom post type content. Taxonomy meta is a fairly new feature to wordpress yet. We might expand the custom field filters for taxonomy term meta as well.

    Best,
    Ernest Marcinko

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


    #25506
    danielecelsa07
    danielecelsa07
    Participant

    Thanks for the explanation.

    You said Taxonomies are new in WordPress, the same thing is for Category/Tag? Or maybe is possible to filter Category/Tag content?

    Kindly think to expand the custom field filters for taxonomy term, it would be really useful 🙂

    Thanks,
    Daniele

    #25525
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I meant taxonomy meta, not the Taxonomies 🙂 Taxonomies are there since the beginning, the term meta is a bit newer addition. We will surely expand the custom field filters to the taxonomies in the future – we don’t have a timeline yet, but it is going to be added within a few releases.

    Best,
    Ernest Marcinko

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


    #25544
    danielecelsa07
    danielecelsa07
    Participant

    Thanks Ernest for your reply, now is clear 🙂

    So, I am trying to change my mind and instead of using Taxonomy, I am using CPT hierarchical. In this way I will be able to apply filters.
    But I didn’t find a way to filter this kind of CPT through Ajax Search Pro filter. Can you suggest to me how to do?

    I am trying to filter based on the fathers. So I would like to have a filter on the father terms, and searching the sons (this is because I have same sons name, but each one assigned to a different father)

    EX:
    -FATHER1
    —-CHILD_A
    —-CHILD_B
    -FATHER2
    —-CHILD_A

    So I would like to filter for ‘FATHER1’ and typing ‘CHILD_A’ to receive only the result son of FATHER1

    I hope to have been clear. If necessary, I can open a new topic for this.

    Thanks,
    Daniele

    #25560
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Okay, so I need a bit more information about this:

    -FATHER1
    —-CHILD_A
    —-CHILD_B
    -FATHER2
    —-CHILD_A

    – Are these the posts in this hierarchy?
    – ..or the taxonomy terms?

    Because the problem with both approaches is, that you cannot filter terms by terms, nor posts by posts. The filters only work for filtering CPTs by Taxonomy terms or custom fields.
    I think, the best solution would be, to make CPT-s, and tag them with the hierarchical terms. That way, you can use the taxonomy filters to filrter the CPT by the terms.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.