Help Desk

Creating events search form on homepage

  • | Permalink

    Hi,

    I am currently struggling to implement a search form based off of Events Calender Pro and the filter bar add-on. We purchased the filter bar to make the following process easier but it has proven to be anything but easier.
    Essentially I need three fields (Categories, City and Province/State) with a submit button, naturally.

    I have managed to generate the submit button and a categories dropdown which works perfectly, however I can’t seem to generate the city and Province/States dropdowns. I know that they are reliant on venues and I have attempted multiple scenarios, but with no success. Could someone please assist with this and guide me in the right direction. Please see below the code I implemented to get the categories dropdown to work.

    <?php
    $taxonomy = TribeEvents::TAXONOMY;
    $orderby = ‘name’;
    $show_count = 1; // 1 for yes, 0 for no
    $pad_counts = 0; // 1 for yes, 0 for no
    $hierarchical = 1; // 1 for yes, 0 for no
    $title = ”;

    $args = array(
    ‘taxonomy’ => $taxonomy,
    ‘orderby’ => $orderby,
    ‘show_count’ => $show_count,
    ‘hierarchical’ => $hierarchical,
    ‘title_li’ => $title
    );
    ?>

    form code:

    <div class=”categories-container”>
    <?php $cats = get_categories($args); ?>
    <select id=”categories”>
    <option selected value=”” disabled>Event Categories</option>
    <?php foreach ($cats as $cat) : ?>
    <option value=”<?php echo get_term_link($cat, $cat->taxonomy) ?>”><?php echo $cat->name ?></option>
    <?php endforeach; ?>
    </select>
    </div>

    script:

    <script>
    jQuery(document).ready(function()
    {
    jQuery(‘#tribe-bar-form’).submit(function()
    {
    window.location = jQuery(‘#categories’).val();
    return false;
    });
    });
    </script>

    Thanks in advance.

    Kind Regards

    | Permalink

    The above code was found through immense amounts of research. I tried to follow the same structure for the city and state/province dropdowns but with no success.

    Posts: 2364
    | Permalink

    Hi there,

    Thanks for reaching out. Please note that we do not offer product support or customization help here in the Pre Sales forum. If you have a license for one of our Premium Plugins, you can log in with the email associated with the license, and post these kinds of questions in one of the premium plugin forums.

    Thanks,
    Sky

    Posts: 65
    | Permalink

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team