Okay
  Public Ticket #1916127
Filters
Closed

Comments

  • Melanie started the conversation

    Hi,

    Is there a way to set the default filters to 'off'.  They are all selected when I select the filter which makes it time consuming to unselect the ones that aren't relevant to the search.  See attached.

    Thanks.


    Melanie

  •  894
    Zhivko replied

    Hi,

    We'll add check/uncheck all buttons in future update.

    Meanwhile you can add this code in your theme functions.php file at the bottom:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                if (typeof $.stecExtend === 'undefined') {
                    return;
                }
                $.stecExtend(function (m) {
                    m.$instance.find('.stec-top-menu-filter-by-category ul li').each(function () {
                        $(this).removeClass('active');
                        $(this).find('i')
                                .removeClass('fas fa-square')
                                .addClass('far fa-square');
                    });
                    m.calData.categoriesFilter = [];
                }, 'onAddToEventsPool');
            })(jQuery);
        </script>
        <?php
    });

    This code will uncheck all categories by default.


    Stachethemes Developer

  • Melanie replied

    Thanks.  That worked well for Categories.  Please could you give me the code for resetting the filters for Location.  Thanks.

  • Melanie replied

    Please could you also give me the code for displaying the Locations in the filter in alphabetical order.  Thanks.

  •  894
    Zhivko replied

    Place the attached file to stachethemes_event_calendar/front/js/adds folder.


    Stachethemes Developer