Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1467697

    How can we make it so that people can only select one Day and Time at a time, on the filters? We don’t want them to select multiples on the filter check boxes.

    #1467708

    Hey amyncuih,

    Thank you for the inquiry.

    You may need to contact the plugin developer regarding this, as these options are added by the plugin, not by the theme. You can try adding this script to the functions.php file, but we cannot guarantee that it will work.

    
    function ava_custom_script_here()
    {
        ?>
        <script>
            (function ($)
            {
                document.addEventListener('DOMContentLoaded', function ()
                {
                    const checkboxes = document.querySelectorAll('.tribe-common-form-control-checkbox__input[name="tribe_dayofweek[]"]');
    
                    checkboxes.forEach(function (checkbox)
                    {
                        checkbox.addEventListener('change', function ()
                        {
                            if (this.checked)
                            {
                                checkboxes.forEach(function (otherCheckbox)
                                {
                                    if (otherCheckbox !== checkbox)
                                    {
                                        otherCheckbox.checked = false;
                                    }
                                });
                            }
                        });
                    });
                });
            })(jQuery);
        </script>
        <?php
    }
    add_action('wp_footer', 'ava_custom_script_here');

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.