• Resolved Agramonis

    (@agramonis)


    Hi,

    on my page I have a custom field (text field), Arbeitsh?he, and I want to filter that.

    How you can see, there are only 4 products, with Arbeitsh?he 20m, 24m, 39m and 10m.

    I added arbeitshoehe as custom field filter on your plugin, but why does it show only the terms 20m (1) and 25m (0)?

    Below I created to test a custom numeric field, with 2 values, and the range slider works.

    Ty

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author stepasyuk

    (@stepasyuk)

    Hi @agramonis

    Thank you for using Filter Everything plugin.

    Filter Everything creates filter terms based on data stored in post meta field. So if you see only two values it means your posts have only these two values. Maybe other posts do not have any values or these values could be broken.

    The best way is to check data in PhpMyAdmin. You can install phpMyAdmin plugin in WordPress, open your DataBase, select wp_postmeta table, select Search tab in it and search in the field meta_key by value ‘arbeitshoehe’?and select %LIKE% as Operator. You will see something like this example https://prnt.sc/DKlYIVlzSLPi for meta key _price. Please, provide me with?link to the screenshot of your search results.

    Thread Starter Agramonis

    (@agramonis)

    Hi,

    thank you for the fast reply.

    Here is the screenshot: https://prnt.sc/MoNvAsnD53gw

    Plugin Author stepasyuk

    (@stepasyuk)

    @agramonis

    Thank you for the data you provided.

    Hmm, it’s very strange. It looks like something affects on the SQL-query that retreives filter terms from the DB.

    Can you please do one more thing:
    – install plugin Query Monitor
    – open page with filters on frontend with additional parameter in URL ?reset_filters_cache=true For example https://example.com/?reset_filters_cache=true
    – select in the admin bar Query Monitor -> Queries
    – press Ctrl + F and try to search by meta key arbeitshoehe
    – you have to find SQL query that is generated by the the method FilterEverything\Filter\PostMetaEntity->selectTerms
    and looks like this https://prnt.sc/IhzUFZ_To40Q In my case meta key is multiple_choices
    – make screenshot of this SQL query and provide me with link to this screenshot

    This have to explain where could be potential problem.

    Thread Starter Agramonis

    (@agramonis)

    Hi,

    here we go, thats the link https://prnt.sc/6pVDc9sUkMZW

    ty

    Thread Starter Agramonis

    (@agramonis)

    Hi,

    do you need any further informations?

    ty

    Plugin Author stepasyuk

    (@stepasyuk)

    Hi @agramonis

    Sorry for the late response and thank you for the screenshot you provided. It is known issue and it was already solved for the next plugin version. It is related with WPML and that fact that your products are not translatable post type.

    If you want to solve it faster, please replace code in the file /wp-content/plugins/filter-everything/src/Entities/PostMetaEntity.php with?this code – https://gist.github.com/wpserve/acd1ada2b9024c306ae891c9e8f85887 and update your Filter Set.

    • This reply was modified 2 years ago by stepasyuk.
    Thread Starter Agramonis

    (@agramonis)

    Hi, ty.

    No it seems to work perfect.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Filter ACF custom field’ is closed to new replies.