Creating additional filter bar items based on "Additional Filters" information

Home Forums Calendar Products Filter Bar Creating additional filter bar items based on "Additional Filters" information

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #990536
    activeyouth
    Participant

    We used the code on this page http://pastebin.com/30mZSeKk and it did add a “Taxonomy” item to the filterbar, however, how do we change the data that’s being pulled in to reflect items in the “Additional Filters” area instead of “Taxonomy”?

    If you could provide a code sample, that would be very helpful.

    Thank you,
    Dawn

    #990747
    Barry
    Member

    Hi Dawn,

    Looks like you’ve made a great start!

    Please note, however, that when it comes to custom development tasks the amount of support we can offer up is – regrettably – somewhat limited.

    how do we change the data that’s being pulled in to reflect items in the “Additional Filters” area instead of “Taxonomy”?

    I feel like I’m missing some context, here … when you speak of “Additional Filters” what are you referring to?

    #990756
    activeyouth
    Participant

    It’s the additional fields that you can set up as a feature of events calendar pro.

    You set them up by going to Events> settings>Additional Fields.

    After these fields are set up and then selected when setting up an event, I want to be able to filter on them through the filter bar.

    #990779
    Barry
    Member

    Ah, I see – thanks for clarifying 🙂

    So Event Calendar PRO’s additional fields are, ultimately, stored pretty much the same way as are regular WordPress custom fields – and so you can take advantage of meta/custom field queries here – but there is a slight difference in that the meta key for these fields usually follow this sort of form:

    _ecp_custom_x

    Where x is a number. To determine which number exactly for any given field, your code would need to load the current “map” via:

    tribe_get_option( 'custom-fields' );

    You should get back something like this:

    [
        1 => [
            'name'  => '_ecp_custom_1',
            'label' => 'Nearest town',
            ...
        ],
        2 => [
            'name'  => '_ecp_custom_2',
            'label' => 'Age restriction',
            ...
        ], ...
    ]

    Armed with this information, your own custom filter can – through the setup_query_args() method – apply some custom field queries to match whatever has been specified by the current user.

    I hope that gives you some ideas – and good luck with the customization 🙂

    #995072
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Creating additional filter bar items based on "Additional Filters" information’ is closed to new replies.