Filter bar does not properly reset

Home Forums Calendar Products Filter Bar Filter bar does not properly reset

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1020474
    Jacob
    Participant

    Dear tribe team,

    My filter bar is defined to precheck the checkbox for a certain venue when the calendar loads. This is good. However, when I reset the filter (using the button) the prececked checkbox stays checked. Can you help me to modify this piece of code you gave me to allow the filter button to properly work?

    add_filter( ‘tribe_events_filter_values’, ‘modify_filter_venues’, 20, 2);
    function modify_filter_venues ( $filter_values, $slug ) {

    if($slug == ‘venues’) {
    $venue_id = 388;

    if ( $key = array_search($venue_id, array_column($filter_values, ‘value’)) ) {
    $selected_venue = array_splice($filter_values, $key, 1);
    array_unshift($filter_values, $selected_venue[0]);
    }
    }

    return $filter_values;
    }

    #1020798
    Nico
    Member

    Hi Jacob,

    Glad to help you once again here! I think I provided this snippet a while back.

    So what is the exact behavior you are trying to achieve here? Having the venue pre-selected when the user loads the page but if on the same page the user clicks ‘Reset Filter then clean that out? If this customization gets a bit complex I’ll probably won’t write to code for you but at least I can point you in the right direction.

    Please let me know about this and I’ll try to help you out,
    Best,
    Nico

    #1075323
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Filter bar does not properly reset’ is closed to new replies.