Hide ticket fields after sale window is over

Home Forums Ticket Products Event Tickets Plus Hide ticket fields after sale window is over

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1444265
    TJ
    Participant

    Hi –

    Is there a way to hide the ticket-related fields for an event when the sales window has passed? For example, I’d like to remove the price and the large “Tickets” header when nothing is on sale. See screenshot.

    Thanks!

    TJ

    #1445615
    skunkperecords
    Participant

    Same here. We want to stop selling tickets one hour before the start of the event (12:00pm) and we have set the “End Sale” in the ticket settings for 11:00am. If the event is not sold out, tickets are still available until the end-time of the event (4:00pm), not the end sale time. Any way to have the tickets not show on the single event page after a specified time? (11:00am in our case). Thanks so much.

    #1448064
    Jennifer
    Keymaster

    Hi TJ,

    There should be a message that displays to notify users that tickets are not currently available. We have an internal ticket open to address this issue, and I’ve linked this thread to it – as soon as we have an update, we’ll let you know here.

    In the meantime, you can customize the template for the ticket form to hide it when tickets are not available. You’ll need to follow the instructions in our themer’s guide to copy the template into your child theme for editing. The template can be found at wp-content/plugins/event-tickets-plus/src/views/wootickets/tickets.php. I went ahead and made an example for you here, which will simply hide the entire form if there are no tickets currently on sale.

    Please let me know if this helps and if you have any questions!

    Thanks,

    Jennifer

    #1448079
    Jennifer
    Keymaster

    Hi @skunkperecords,

    The tickets shouldn’t be available after the end sale time.

    Since this isn’t working for you, can you please open up a new thread and share your system info with us so that we can help you get this figured out? If you haven’t done so already, you’ll also want to test for conflicts with your theme and other plugins.

    Thanks,

    Jennifer

    #1448832
    TJ
    Participant

    Hi Jennifer. Thanks for the sample! Works great for now.

    Can you also tell me how to hide / tweak the price text that is getting added next to the date (see original screenshot “February 3rd @ 7:30 am – $20”)?

    #1448876
    TJ
    Participant

    Hi Jennifer –

    I lied; the above change did not work. I simply wrapped the form in

    This ended up always hiding the ticket form; was never evaluating to true.

    Did I do something wrong?

    TJ

    #1453393
    Jennifer
    Keymaster

    Hi TJ,

    I’m sorry that it’s not working…Did you copy the template I sent you into your copy of the tickets.php template in your child theme? I just tested it out again on my end…the form is completely hidden after the ticket sale period, but it does display when tickets are on sale.

    Did you wrap the form in an “if” statement using the tribe_events_has_tickets_on_sale() function? It looks like you may have copied the code you used into your reply, but if so, it did not come through.

    If the example I sent isn’t working for you, I would recommend testing for conflicts with your theme and other plugins to see if there is something else that might be interfering.

    Regarding the price next to the date and time, you can find the code for that in the single-event.php template (found at wp-content/plugins/the-events-calendar/src/views:

    ', '

    ' ); endif; ?>


    You can edit this template the same way as the tickets.php template, by following the instructions in our themer’s guide.

    Let me know if you’re able to get it working!

    #1456207
    TJ
    Participant

    Hi Jennifer –

    The fix for hiding the tickets form when tickets are not on sale, does actually now work. I tested it incorrectly last time I wrote in.

    Just curious though – how come you don’t have to pass in the $event_id to the tribe_events_has_tickets_on_sale() function?

    Regarding, hiding the price
    – I’ve copied wp-content/the-events-calendar/src/views/single-event.php -> themes/[my-theme]/tribe-events/single-event.php
    – I added a check in here to see if tickets were on sale to line 44: https://gist.github.com/steakchaser/354ecbedef850f0d16d934d55330c5cb

    The price still shows up. What am I doing wrong?

    Thanks!

    TJ

    • This reply was modified 6 years, 2 months ago by TJ.
    • This reply was modified 6 years, 2 months ago by TJ.
    • This reply was modified 6 years, 2 months ago by TJ.
    • This reply was modified 6 years, 2 months ago by Leah.
    #1456212
    TJ
    Participant

    Hi Jennifer –

    The fix for hiding the tickets form when tickets are not on sale, does actually now work. I tested it incorrectly last time I wrote in.

    Just curious though – how come you don’t have to pass in the $event_id to the tribe_events_has_tickets_on_sale() function?

    Regarding, hiding the price
    – I’ve copied wp-content/the-events-calendar/src/views/single-event.php -> themes/[my-theme]/tribe-events/single-event.php
    – I added a check in here to see if tickets were on sale to line 44: https://gist.github.com/steakchaser/354ecbedef850f0d16d934d55330c5cb

    The price still shows up. What am I doing wrong?

    Thanks!

    TJ

    #1463056
    Jennifer
    Keymaster

    Hi TJ,

    So sorry for the delayed response here, we’ve had a very high volume of threads in the forums here lately. I apologize about that!

    I’m glad that code is working for you…You are right, the tribe_events_has_tickets_on_sale function actually should be passed the event ID.

    For the price, I copied and pasted your template into my local environment, and it is working for me…when tickets are on sale, the price shows up (see screenshot), but it is hidden when the current date is outside the on-sale date range (see screenshot).

    Two things I noticed:

    • You’re using the Enfold theme, which has it’s own templates that override our template files. I believe you may need to take one extra step to get your template displayed instead of the Enfold version. I did a quick search to see if I could find any instructions for you, and I came across this thread, which looks like it has what you need (I was not able to see everything as you need to login to see the rest, but you should be able to access it if you have an active license). Also, as the user points out in that thread, you may want to make this modification in the Enfold version of the single-event.php template instead of our default version.
    • You are using an older version of The Events Calendar (4.6.8). Can you try updating to the current version (4.6.11.1) to see if that makes a difference? If you don’t see a prompt to update in the Plugins section of your Dashboard, you can do so manually by following these instructions.

    Please let me know if this helps!

    Thanks,

    Jennifer

    #1482439
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Hide ticket fields after sale window is over’ is closed to new replies.