hide tickets left until there are 20 spots left

Home Forums Calendar Products Events Calendar PRO hide tickets left until there are 20 spots left

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1337365
    Stephan
    Participant

    hi!
    i want to hide the numbers of tickets left until there are 20 tickets left.

    i found this post/code

    https://theeventscalendar.com/support/forums/topic/hide-tickets-remaining/#dl_post-1290633

    and tried the code but it doesn’t work. should this code run with the actual version of events calendar pro?

    thanks for some tips
    stephan

    #1338293
    Andras
    Keymaster

    Hey Stephan,

    Thanks for reaching out!

    I checked the code on my test site with the twentyseventeen theme and I can confirm the code still works.

    You will need to change the following line to meet your needs:

    if ( ! isNaN( qty_remaining ) && 3 < qty_remaining ) {

    to I believe:

    if ( ! isNaN( qty_remaining ) && 20 < qty_remaining ) {

    Please check and let me know if that does the trick.

    Cheers,
    Andras

    #1338430
    Stephan
    Participant

    Hi András!
    Thanks for your reply. This code works on the detail-page but not in the listview. Can i add this to the listview too?
    Thanks!
    Stephan

    #1338742
    Andras
    Keymaster

    Hi,

    The list view is more tricky to do. I will need to ask around if someone has a solution for this or not.

    As a workaround you potentially can totally hide the number of remaining tickets with this snipped:

    .events-list .tribe-tickets-left {
    display: none !important;
    }

    Would this work for you?

    Andras

    #1338909
    Stephan
    Participant

    Hi András,
    thanks for your message. This will work for me but if you find a solution for the listview please inform me!
    Thanks!
    Stephan

    #1339017
    Andras
    Keymaster

    Hi Stephan,

    Meanwhile I got 2 other recos from two colleagues.

    1.

    One is to do a loop like this, so the code is applied to each item in the list view.

    2.

    Or you can try using the tribe_tickets_buy_button() filter.

    add_filter( 'tribe_tickets_buy_button', 'my_func', 10, 4 );
    
    function my_func( $html, $parts, $types, $event_id ) {
    // use $event_id to get this event's tickets and determine if $html should remain unchanged or if it should be set to blank
    }

    I hope this will help you get started.

    Cheers,
    Andras

    #1339910
    Stephan
    Participant

    thanks, i will try it the next days!

    stephan

    #1341375
    Andras
    Keymaster

    Awesome! Would love to hear what you end up with.

    Cheers,
    Andras

    #1341618
    Stephan
    Participant

    Hi András,
    the big boss has decided that it should only appear on the details page and may be missing on the page. Therefore the problem is solved for the moment.

    Now there are only problems with the printout of the tickets and the PDF download. But I already have posts.

    Thanks!
    Stephan

    #1341989
    Andras
    Keymaster

    That is great to hear Stephan!

    Since the issue is resolved I am going to close this ticket. Regarding the pdf download issue I’ll get back to you in the other thread we have going.

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘hide tickets left until there are 20 spots left’ is closed to new replies.