• Resolved victorakio

    (@victorakio)


    Hi, is there a way to show only the available remaining events? i tried using the shortcode [qem id=’remaining’], but it shows the events even if the the registration is over.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Alan Fuller

    (@alanfuller)

    Can you clarify what you mean available remaining

    Do you mean future events that are not sold out?

    Can you give me some examples so i can understand what you are trying to achieve?

    Thread Starter victorakio

    (@victorakio)

    Hi Alan, yes that’s exactly it. I need to show only the future events that are not sold out yet.

    Plugin Author Alan Fuller

    (@alanfuller)

    It is not a standard feature of the plugin, and I expect fairly niche requirement to fully hide sold out events.

    You can set registration form not to be displayed on full events – and that I expect is more normal.

    However if you want to do you can use a little bit of jQuery, if you know how to add that. So set the registration form not to be shown and then use the text to hide the event e.g.

    <script>
    jQuery(document).ready(function($) {
    $('.qem:contains("Registration is closed")').hide()
    })
    </script>
    Thread Starter victorakio

    (@victorakio)

    Oh ok, i’ll try to hide it with jQuery then.

    Thanks for the response!

    Plugin Author Alan Fuller

    (@alanfuller)

    Let me know how you get on. I tested that code so it should be fine.

    Plugin Author Alan Fuller

    (@alanfuller)

    Did it go OK?

    Thread Starter victorakio

    (@victorakio)

    Hi Alan,

    Yes the solution worked fine, just used vanilla JS instead of jQuery.

    Thank you for the help.

    Plugin Author Alan Fuller

    (@alanfuller)

    Nice if you could share you snippet to the community

    Thread Starter victorakio

    (@victorakio)

    Sure, this is the code i used:

    
    const allEvents = document.querySelectorAll(".qem");
    
      for (i = 0; i <= allEvents.length - 1; i++) {
        if (
          allEvents[i].children[1].children[5].innerText ===
            "Registration is closed" ||
          allEvents[i].children[1].children[4].innerText ===
            "Registration is closed"
        ) {
          allEvents[i].style.display = "none";
        }
      }
    
    Plugin Author Alan Fuller

    (@alanfuller)

    thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to show only remaining available events’ is closed to new replies.