Okay
  Public Ticket #1718141
Changing color for sold out events on full view calendar
Closed

Comments

  • Arydiel started the conversation

    We need some way for visitors to be able to tell if the event is sold out when they are looking at the full view (grid) calendar. I'm wondering if we can modify the code to either change the color of the event, gray out the event, or add sold out to the end of the event title...can you think of a way to do this? If so please tell us how and where to edit the code.

  •  788
    Zhivko replied

    Hi,

    I guess you could add filter in your theme functions.php:

    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            (function ($) {             if (typeof $.stecExtend !== 'function') {
                    return;
                }             $.stecExtend(function (master, events) {                 $.each(events, function () {                                          // Condition                     var isSoldOut = true;                                          // Turn event color gray if is sold out                     if (isSoldOut) {
                            this.color = '#ececec';
                        }                 });             }, 'onAddToEventsPool');         })(jQuery);
        </script>
        <?php
    });

    You will have to write your condition for the "isSoldOut" variable.



    Stachethemes Developer

  • Arydiel replied

    :) Thank you that seems to work.