Home › Forums › Calendar Products › Events Calendar PRO › hide tickets left until there are 20 spots left
- This topic has 10 replies, 2 voices, and was last updated 6 years, 8 months ago by Stephan.
-
AuthorPosts
-
August 18, 2017 at 8:35 am #1337365StephanParticipant
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
stephanAugust 21, 2017 at 2:36 pm #1338293AndrasKeymasterHey 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,
AndrasAugust 21, 2017 at 11:32 pm #1338430StephanParticipantHi 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!
StephanAugust 22, 2017 at 1:29 pm #1338742AndrasKeymasterHi,
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
August 22, 2017 at 10:56 pm #1338909StephanParticipantHi András,
thanks for your message. This will work for me but if you find a solution for the listview please inform me!
Thanks!
StephanAugust 23, 2017 at 6:29 am #1339017AndrasKeymasterHi 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,
AndrasAugust 24, 2017 at 10:12 am #1339910StephanParticipantthanks, i will try it the next days!
stephan
August 28, 2017 at 1:35 pm #1341375AndrasKeymasterAwesome! Would love to hear what you end up with.
Cheers,
AndrasAugust 29, 2017 at 1:53 am #1341618StephanParticipantHi 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!
StephanAugust 29, 2017 at 12:11 pm #1341989AndrasKeymasterThat 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,
AndrasPS: 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!
-
AuthorPosts
- The topic ‘hide tickets left until there are 20 spots left’ is closed to new replies.