Okay
  Public Ticket #1899541
Ticket Problem for Recurring Events
Closed

Comments

  • Putri Nadia started the conversation

    Hi Support,

    Currently I have classes that will happen weekly for 6 times. So, I created a recurring event that will repeat for 6 times. However, I noticed that users can still purchase ticket eventhough the class has started on its first week. How can I make the ticket sales to end whenever the class is starting its first week?

  •  894
    Zhivko replied

    Hi,

    Add this code to your theme functions.php file at the bottom:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {             if (typeof $.stecExtend !== 'function') {
                    return;
                }             $('.stec').on('onEventToggleOpen', function (e, data) {
                    if (parseInt(data.repeatOffset, 10) > 0) {
                        data.$instance.find('.stec-layout-event.active .stec-form-booking').remove();
                    }
                });         })(jQuery);
        </script>
        <?php
    });

    This code basically looks if the event is recurrent and if so it will remove the booking form.


    Stachethemes Developer

  • Putri Nadia replied

    Hi, the code works and it removes the booking form. But can I have it displays a message like 'The booking has to be made on the first class date' ?

    Thank you.

  •  894
    Zhivko replied

    Edit the code to:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                if (typeof $.stecExtend !== 'function') {
                    return;
                }
                $('.stec').on('onEventToggleOpen', function (e, data) {
                    if (parseInt(data.repeatOffset, 10) > 0) {
                        data.$instance.find('.stec-layout-event.active .stec-form-booking').before('<p>The booking has to be made on the first class date</p>');
                        data.$instance.find('.stec-layout-event.active .stec-form-booking').remove();
                    }
                });
            })(jQuery);
        </script>
        <?php
    });

    Stachethemes Developer

  •   Putri Nadia replied privately
  •  94
    Valentin replied

    Have you been updating your theme after entering the code?

    Stachethemes Support
    My Time Zone is GMT+3


    Envato Profile | Facebook | Twitter | Newsletter | Rate & Review

  • Putri Nadia replied

    No I haven't updated the theme.

  • Putri Nadia replied

    Hi Support,

    Is the developer well? Sorry to push you but my problem is kinda urgent because my website is now live and customers are coming in.

    Hope you get better soon,

    Thank you.

  •  894
    Zhivko replied

    Hi,

    Could you provide me with ftp to check it out?


    Stachethemes Developer

  • Putri Nadia replied

    Host name: itrainkids.com

    Username: [email protected]

    Password: stachethemes2019

  •  894
    Zhivko replied

    Hi,

    Sorry for the delay. 

    I've cleared your site cache and the problem should be resolved.


    Stachethemes Developer