Okay
  Public Ticket #2114078
Recurring only one Ticket for all
Closed

Comments

  • phirstfilm started the conversation

    Hello I'm having some recurring events like classes:

    Tango 1 | 01.01.2019 19:00-20:15 

    Tango  | 08.01.2019 19:00-20:15 

    Tango 1 | 15.01.2019 19:00-20:15 

    Tango 1 | 22.01.2019 19:00-20:15 

    Now I want to show all events in the calendar but let the customer book a ticket which holds all 4 dates. So if you click on any of the event you should be able to book just one ticket which is for all 4 events. (the custom should not be able to select just one date or a specific date, because it's gonna be one event with 4 lessons over 4 weeks.)

    How do I do that?

  •  894
    Zhivko replied

    Hi,

    You could disable the date selector with filter.

    Example:

    Add following code in your theme (or theme-child if active) functions.php file at the bottom:

    /**
     * STEC Custom func
     * Disable booking date selector
     */
    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">         (function ($) {
                
                // Disable func
                function disableDateSelector(m) {
                    
                    var textReplace = 'All dates'; // can be anything
                    
                    var $dateSelector = m.$instance.find('select[name="stec_book_date"]');
                    
                    $dateSelector.children(':selected').text(textReplace);
                    
                    $dateSelector
                            .css('opacity', 0.5)
                            .prop('disabled', true);
                }             // Disable for calendar event inner
                $('.stec').on('onEventToggleOpen', function (e, m) {
                    disableDateSelector(m);
                });
                
                // Disable for single event pages
                if (typeof window.stecSingleEvent !== 'undefined') {
                    disableDateSelector({
                        $instance: $('.stec-layout-single')
                    });
                }         })(jQuery);
        </script>
        <?php
    }, 9999);



    Stachethemes Developer