Support

Home Forums Event Espresso Premium Which cron job handles changing event status?

Which cron job handles changing event status?

Posted: July 4, 2017 at 5:05 pm


Affinity

July 4, 2017 at 5:05 pm

Hi there,

We contacted you recently about this issue:
https://eventespresso.com/topic/automatically-changing-from-sold-out-to-open/

I installed the wp-control plugin as you recommended.

I created an event, checked out the only ticket and the event showed up as sold out. Then I canceled the ticket and ran every cron job that seemed related but the status of the event still showed up as sold out.

Can you tell me which one will change the status of an event from “sold out” to “open” after a ticket is returned?

These are the cron jobs I tried:

EE_Messages_Scheduler::batch_generation()
EE_Messages_Scheduler::batch_sending()
EE_Cron_Tasks::clean_out_junk_transactions()
EE_Cron_Tasks::expired_transaction_check()
EE_Messages_Scheduler::cleanup()
PluginUpdateEngineChecker->checkForUpdates()
check_plugin_updates-event-espresso-core-reg
check_plugin_updates-eea-promotions
check_plugin_updates-ee4-events-calendar
check_plugin_updates-eea-multi-event-registration
check_plugin_updates-eea-events-table-view-template
check_plugin_updates-eea-stripe-gateway
check_plugin_updates-eea-attendee-mover
EE_Cron_Tasks::clean_out_old_gateway_logs()

Thank you!


Josh

  • Support Staff

July 5, 2017 at 10:11 am

Hi there,

The EE_Cron_Tasks::expired_transaction_check() action will kick things off which will lead to the tickets getting released back into the inventory. Then if the conditions are right, the event’s tickets will go from from sold out to available again. Important note: There will likely be more than one cron task in the list with that name. Each one is tied to a specific transaction (and the Transaction ID) will match the parameter related to the transaction in question. It’s also important to note that if you try to fire the cron early (before the session is expired, and the session is still open) the reserved ticket will not be released back into the inventory).


Affinity

July 5, 2017 at 12:47 pm

AHEE__EE_Cron_Tasks__expired_transaction_check sounds like it will remove a transaction that doesn’t get completed by the user. I.e. they don’t complete the checkout process. I see that is only runs once shortly after the checkout process is initiated.

I’m not sure that’s what we’re after. What we’re after is having the status reopen after a user cancels a ticket they previously purchased. I’m guessing that cron job won’t run two days later if they come back and cancel.

Also I see this strange message at the top of the event edit page:

“Please note that the Event Status has automatically been changed to Sold Out because more spaces have become available for this event…”

Perhaps we’ve just configured the system incorrectly? I’m just not familiar enough with EE to know if that’s normal.

When editing the event, there doesn’t seem to be a status in the list which indicates that tickets are available. The available statuses are: pending, draft, cancelled, postponed, sold out.


Josh

  • Support Staff

July 5, 2017 at 1:04 pm

What we’re after is having the status reopen after a user cancels a ticket they previously purchased. I’m guessing that cron job won’t run two days later if they come back and cancel.

May I ask how exactly are they coming back and cancelling? The reason I ask is because there isn’t a feature in Event Espresso 4 that allows them to cancel their own registration. That’s an admin only feature, maybe you have a plugin (or other modification) that adds this?

When editing the event, there doesn’t seem to be a status in the list which indicates that tickets are available. The available statuses are: pending, draft, cancelled, postponed, sold out.

There isn’t exactly a 1-1 relationship between the event status and whether tickets are available, but you should also see a Published status option. So the event will have tickets available if it is Published or alternatively Draft status, and all of the following conditions are met:

  • The Datetime’s Event End is after the current time
  • The Datetime’s Limit is greater than the Sold + Rsrvd count
  • The ticket’s Sale starts date is before the current time
  • The ticket’s sell until date is after the current time
  • The ticket’s quantity is greater than the Sold + Rsrvd count
  • The Event’s Display Ticket Selector option is set to Yes


Affinity

July 5, 2017 at 3:44 pm

When I complete my registration as an anonymous user, I am taken to a thank you page which has “Registration Details” including a link to “edit info”. If I click on that link, I am taken back to the registration checkout which allows me to edit my name/email and also cancel my registration.

If I cancel my registration, I see the AHEE__EE_Cron_Tasks__expired_transaction_check job in the queue for that purchase.

Time passes and the cron job disappears from the queue but my registration still shows as approved and complete in the registration list and the event itself is sold out. (I believe the client is experiencing the same issue if the customer simply doesn’t complete the registration process)

If, as an administrator, I go to the registration queue and cancel the registration, the event still shows up as sold out. Even after the cron job runs.

I see under Available Tickets (on the event edit page) that 0 tickets are sold but 1 registration still exists.


Josh

  • Support Staff

July 5, 2017 at 3:54 pm

Hi there,

If I click on that link, I am taken back to the registration checkout which allows me to edit my name/email and also cancel my registration.

Currently the link on the front end doesn’t actually set the registration status to cancelled. That’s a feature that might get added in the future though.

If, as an administrator, I go to the registration queue and cancel the registration, the event still shows up as sold out. Even after the cron job runs.

I don’t believe there’s a cron job attached to cancelling a registration on the back end. When you edit an Approved registration, and set its status to cancelled, that registration’s ticket will be released back into the inventory on the same request. At that point it should open back up for registration.


Affinity

July 6, 2017 at 11:11 am

Currently the link on the front end doesn’t actually set the registration status to cancelled.

So that “cancel” button doesn’t do anything?

When you edit an Approved registration, and set its status to cancelled, that registration’s ticket will be released back into the inventory on the same request. At that point it should open back up for registration.

I tried this and it didn’t work as you described. I bought the only ticket then went to the approved registration and changed the status to cancelled.

When I go back to the event, the number of tickets sold goes back to 0 but the status is still sold out.

There is this strange text at the top of the event edit page:

Please note that the Event Status has automatically been changed to Sold Out because more spaces have become available for this event

The text seems to contradict itself. Looks like a bug? I’m guessing this is not how it usually works.

At that point, if I click on the publish button from the event edit page, the event is no longer sold out.

The real use case that we’re trying to solve here is that a customer starts a registration and never finishes. The cron job should cancel the order and set the event back to not sold out but I believe the behaviour of EE is the same as I’ve described above, forcing the admin to come republish the each not-sold-out event.

I turned off all the EE related plugins and still had this problem.


Josh

  • Support Staff

July 7, 2017 at 1:49 pm

So that “cancel” button doesn’t do anything?

It does actually do something because their session will be cleared (and they’ll land on the Registration Cancelled page). The saved registration data isn’t affected though.

I tried this and it didn’t work as you described. I bought the only ticket then went to the approved registration and changed the status to cancelled.
When I go back to the event, the number of tickets sold goes back to 0 but the status is still sold out.
There is this strange text at the top of the event edit page:
Please note that the Event Status has automatically been changed to Sold Out because more spaces have become available for this event

Are you testing this on a current version of Event Espresso 4?


Affinity

July 10, 2017 at 11:56 am

this is what I see from wp plugin list:

| event-espresso-core-reg                      | active   | none   | 4.9.38.p |
| eea-attendee-mover                           | active   | none   | 1.0.1.p  |
| ee4-events-calendar                          | active   | none   | 3.2.9.p  |
| event-espresso-custom-upcoming-events-widget | active   | none   |          |
| eea-events-table-view-template               | active   | none   | 1.3.5.p  |
| eea-multi-event-registration                 | active   | none   | 2.0.12.p |
| eea-promotions                               | active   | none   | 1.0.10.p |
| eea-stripe-gateway                           | active   | none   | 1.0.15.p |


Josh

  • Support Staff

July 10, 2017 at 12:15 pm

Your site’s version is 5 versions behind the current version of Event Espresso 4. You will also need to update to the current version of Event Espresso 4 Multi Event Registration.


Affinity

July 12, 2017 at 10:20 am

I updated all of the related plugins. I’m still having the same issue. If a user doesn’t complete their registration, it remains in the list of registrations (more than 12 hours) with a status: incomplete, payment pending. The event remains sold out. The related cron job has disappeared from the list.

Where do we go from here?


Affinity

July 12, 2017 at 10:25 am

One other thing, I saw this at the top of the event edit page:

Please note that the Event Status has automatically been changed to Published because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets. However, this change is not permanent until you update the event.

When I update the event, the registration is in fact released and the status changed to open. Is this how it is designed to work?

That means that if we have dozens of events, the event coordinator has to be continuously checking each event to see if tickets have been released. I assume that should be automatic?


Josh

  • Support Staff

July 12, 2017 at 11:51 am

If a user doesn’t complete their registration, it remains in the list of registrations (more than 12 hours) with a status: incomplete, payment pending.

That’s exactly what should happen. The software does not delete the registration, and the Pending Payment status means it’s not holding a spot.

The event remains sold out.

If you check that sold out event does it have a number other than 0 for the Datetimes and/or Tickets RSRVD counts? There may be other registrations in progress.

Please note that the Event Status has automatically been changed to Published because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets. However, this change is not permanent until you update the event.
When I update the event, the registration is in fact released and the status changed to open. Is this how it is designed to work?

That will only happen if the event status got switched to Sold out, which doesn’t automatically happen unless the event is actually sold out. When there’s a “sold out” message that appears because there’s a combination of sold + reserved tickets that hit the limit, the event’s status isn’t automatically set to sold out at that point. So there shouldn’t be any need to re-publish the event except in cases where the event’s status was switched over to sold out.


Affinity

July 13, 2017 at 11:01 am

I don’t seem to be able to post to this thread any longer:
https://eventespresso.com/topic/which-cron-job-handles-changing-event-status

I’ll continue from here.

There is 1 ticket for the test event. When a user starts a registration but doesn’t complete it (i.e. doesn’t pay for the ticket), RSRVD changes to 1 and the event status immediately changes to “sold out”. 1 RSRVD + 0 sold = 1 total = the number available = sold out.

This is the behaviour I’d expect but I’m not sure it matches what you have previously stated.

Once the cron job runs (an hour later) RSRVD changes back to 0 but the status stays “Sold out”. Not what I’d expect. At that point I have to check the event and save it again to set the status back active.

I’m sure there are not other registrations in progress.


Affinity

July 13, 2017 at 11:16 am

can’t reply to this?


Affinity

July 13, 2017 at 11:18 am

Oh weird. I’ve been trying to post to this thread for the last two days but my messages silently disappear. I think it was because I changed my account email so that I would get the update notifications. I just changed the address back to the original and now I can post again. Anyway…

There is 1 ticket for the test event. When a user starts a registration but doesn’t complete it (i.e. doesn’t pay for the ticket), RSRVD changes to 1 and the event status immediately changes to “sold out”. 1 RSRVD + 0 sold = 1 total = the number available = sold out.

This is the behaviour I’d expect but I’m not sure it matches what you have previously stated.

Once the cron job runs (an hour later) RSRVD changes back to 0 but the status stays “Sold out”. Not what I’d expect. At that point I have to check the event and save it again to set the status back active.

I’m sure there are not other registrations in progress.


Josh

  • Support Staff

July 13, 2017 at 11:45 am

The event’s change to Sold out is not permanent until you update the event. Are you editing the event at any time during the time the ticket is reserved?


Affinity

July 13, 2017 at 12:15 pm

I’m viewing the event edit page but not updating it.


Josh

  • Support Staff

July 13, 2017 at 8:48 pm

If you’re viewing the event edit page when the cron fires that may prevent the event status from getting set back to open again.


Affinity

July 14, 2017 at 2:16 pm

That seems to have been the issue. Well, and perhaps those updates. This seems like a bug to me. Is there some reason the cron needs to not fire if the edit page is open?


Josh

  • Support Staff

July 14, 2017 at 4:05 pm

The cron acutally does fire, but the problem is when the edit page is open the auto-save can kick in and save the event’s status to be Sold Out. That save basically changes the temporary sold out ticket status to a more permanent sold out event status. If the edit page isn’t open while there’s a temporary sold out status, the temporary status can automatically be switched back when the cron fires. The series of actions that run on a cron will not override what’s been edited on an event edit screen.

You can look at this from another angle: Let’s say the event organizer finds out there’s actually fewer seats available and the limit has been exceeded, so they go in and change the event’s status to sold out, then save. The status is going to need to stay sold out at that point.


Affinity

July 17, 2017 at 12:20 pm

The problem is still present on the production site (fixed on the dev site). As far as I know, dev and prod are set up identically. I’m wondering if another admin were to have an event edit page open for a different event, will it cause this problem for my test event?


Josh

  • Support Staff

July 17, 2017 at 12:24 pm

No because the autosave will only save the event currently being edited. Do you have any caching mechanisms in place on the production that aren’t on dev?

The support post ‘Which cron job handles changing event status?’ 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.

Event Espresso