All-in-One Event Calendar
[resolved] Filter: using AND not OR (10 posts)

  1. fuchsws
    Posted 4 years ago #

    Having the filters by category and tags is a very great feature!

    However I would like to change the behaviour so it's combining the filter settings (AND sql query) instead of adding it (OR/IN query).

    So, for now when you select a category and tags the result will show events for the category OR tags - changing it would result in less events where you can use filters to narrow down your search instead of increasing it.

    seems to me this is could be changend within the "class-ai1ec-events-helper.php", at function filter_by_terms().

    Does someone now how to change the query so it returns only posts having all terms? Very Much appreciated, thanks!


  2. Yani Iliev
    Plugin Contributor

    Posted 4 years ago #

    We are working on enabling AND and OR. Thank you for your feedback.

  3. fuchsws
    Posted 4 years ago #

    I just was wondering if it can be easily implemented into the current version ... as I need it just right now ;-) maybe someone did it already and could give some hints on how to alter the query.

    however, I think it should be implemented in a way it can be controlled by the website user too, so they can decide how to set filters.

    any idea when a new version of the plugin will be ready?

  4. Yani Iliev
    Plugin Contributor

    Posted 4 years ago #

    @ fuchsws
    Ah sure, maybe some could help.

    We are releasing a new version every 2 weeks, however if this features has been implemented, you can download a dev release directly from our website (the-seed dot ca)

  5. fuchsws
    Posted 4 years ago #

    I solved this, so in case somebody is interested in using AND/OR combinations of the filters here you go:

    Replace function filter_by_terms() at "plugins > all-in-one-event-calendar > app > helper > class-ai1ec-events-helper.php" with http://pastebin.com/Rh2hDzWK

    This enables users to get combined results of the filter term_ids.
    Change argument "relation" and "operator" to change the behaviour (see http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters)

    should work in current version (1.3)

  6. toccia
    Posted 3 years ago #

    Thanks a lot. You rock! I got to do it thanks to you! ;)

  7. bnkeith22
    Posted 3 years ago #

    Thanks for the solution :)

    I am going to mark this case as resolved.

  8. kevegard
    Posted 3 years ago #

    not working in 1.9.1... or just for me? any other experience?

  9. kevegard
    Posted 3 years ago #

    sorry. in posterboard view it is working. In monthly view doesnt work.. I try more.

  10. Xistortion
    Posted 3 years ago #

    This is not working for me in any view.

    ai1ec: 1.9.1
    wordpress: 3.4.1

    calendar location:

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic