Posted: June 5, 2015 at 9:23 am
Hi, I’m exploring ways of putting a redirect timer on pages to try to prevent overselling that can occur when two customers register at approximately the same time. In order to test this out, I would like to know when EE checks its ticket inventory. For example, can I put a timer on the event page, the registration page, the billing info page? At what point does the last inventory check occur? If I put the timer after the last check, then it won’t do me any good! Thanks |
|
To be clear, I will be redirecting users back to either the event page, or the event list page, after a set amount of time. |
|
Hi Michael, You can look in the EE core plugin for usage of the is_sold_out() method to see the places where it checks for whether the event is sold out. Along with that, it turns out there is already a built in timer that starts counting down when a registration begins. It begins the moment that a ticket selection is submitted and redirected to the registration form page. You can set the countdown timer to display on the registation checkout page by adding the following code to your theme’s functions.php file or into a custom snippets plugin.
The default time limit is 60 minutes. You can change the time by using a filter hook. For example, the following will change the limit to 30 minutes:
|
|
thank you, Josh. You made this very easy to implement. I’ve observed the following: The timer would be improved if it also applied to the payment step, especially since another ticket inventory check is not performed again. Even though the timer does not apply to Payment Details form, it is still displayed. I found is_sold_out 4 times in the core files, but I can’t get anywhere with it, it’s beyond me. It looks like the last check of inventory happens when user selects payment type. |
|
Thanks for the feedback Michael. Currently the countdown timer isn’t wired up to prevent overselling. It’s simply a way to keep track of how long the session has gone on. Currently there’s an open ticket to address this issue, and this is our plan for it:
I will update this thread when we have this implemented, and added your feedback to the ticket. |
|
Wow, it’s great that you already have a plan for this. Thanks for the update and thanks again for the snippets above. You all do a great job with EE and this forum. |
|
The support post ‘timer to prevent overselling’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.