Support

Home Forums Event Espresso Premium Required Ticket not available should block registration – EE4

Required Ticket not available should block registration – EE4

Posted: September 24, 2014 at 10:22 am


Richard Wallis

September 24, 2014 at 10:22 am

I have defined a [required] main ticket type with a Minimum Qty of 1, Maximum Qty of 4, Qty available 15.
There are other ticket types defined.
I have two significant problems when using the Ticket selector. Firstly, when there are only three main tickets remaining I can select 4 to register – this ends up with 16 sold.
Secondly, in this state that ticket type displays as ‘unavailable’ instead of ‘sold out’. Then even though a required ticket is not available to register I can still register for other ticket types.


Lorenzo Orlando Caum

  • Support Staff

September 24, 2014 at 10:47 am

Hi Richard, the required ticket being unavailable should prevent registrations from working.

Are you on the latest software at 4.4.3?

https://eventespresso.com/wiki/ee4-changelog/


Lorenzo


Richard Wallis

September 24, 2014 at 11:25 am

It is now and that has fixed the first, selling too many tickets, problem.

However the more significant problem is still there. I am sold out of this required ticket but it lets me purchase other tickets.

I am wondering if the cause might be that one of those other tickets is also required.

The scenario is that the event is based on a limited number of child tickets (1 – 4 per party) – to visit Santa. Each group of children need to be accompanied by at least one adult. Hence both ticket types need to be required but the event needs to be limited by the number of child tickets.


Lorenzo Orlando Caum

  • Support Staff

September 24, 2014 at 2:42 pm

Hi Richard,

I was able to verify this issue and I’ve created a report for the development team so we can have this issue fixed.

We will update this support post once we have more information.


Lorenzo


Richard Wallis

September 24, 2014 at 3:31 pm

Great that you have identified this.

Any chance of a patch – this site is due to go live before the end of this week and this is a bit of a showstopper.

~Richard.


Lorenzo Orlando Caum

  • Support Staff

September 24, 2014 at 3:38 pm

I don’t have a patch at this time as I recently created the ticket. Again, we will update this support post once we have more information.


Lorenzo


Richard Wallis

September 24, 2014 at 4:11 pm

OK.

As a work around I have tried updating Events Table View Template as per https://eventespresso.com/topic/ee4-event-table-view-adding-sold-out-in-place-of-register/#post-116467 so that the event list will say Sold Out and prevent the user getting to the Event page.

Unfortunately it appears to suffer from the same problem, I presume calling the same low-level functions. 🙁

~Richard.


Richard Wallis

September 24, 2014 at 7:14 pm

Having spent several hours digging into the code it became clear that if any of the ticket types for an event did not have a qty set, the event would never appear sold out – you always return out of loops on getting an INF qty value from the data.

I added qty values to all my ticket types but still didn’t have much success. I looked for a place to break out of loops (returning a zero remaining value) when ticket sold equals qty and required is true.

At one point I got the event status to change to sold_out but it had no effect in the ticket selector and it didn’t ripple up to the code in Events Table View Template either.

I had to back out my debug & changes as I ended up in a permanent crash mode. Before I did though I copied the following bit of modified code that gave me some success and might help with your diagnosis.


public function sum_tickets_currently_available_at_datetime($DTT_ID, $query_params = array()){
$sum = 0;
$query_params[0]['Datetime.DTT_ID'] = $DTT_ID;
$remaining_per_ticket = $this->_get_all_wpdb_results(
$query_params,
ARRAY_A,
array(
'tickets_remaining'=>array('Ticket.TKT_qty-Ticket.TKT_sold','%d'),//note! calculations based on TKT_qty are dangerous because -1 means infinity in the db!
'initially_available'=>array('Ticket.TKT_qty','%d'),
'required'=>array('Ticket.TKT_required','%d'))
);

if ( empty( $remaining_per_ticket ) )
return FALSE;

foreach($remaining_per_ticket as $remaining){
if($remaining['tickets_remaining'] < 1 && $remaining['required']){
return 0;
}
if(intval($remaining['initially_available'])==EE_INF_IN_DB){//infinite in DB
return INF;
}
$sum+=intval($remaining['tickets_remaining']);
}

return $sum;
}

~Richard


Lorenzo Orlando Caum

  • Support Staff

September 24, 2014 at 7:43 pm

Hi Richard,

Thank you for getting a head start on this. I’ve added your notes to the bug report.


Lorenzo

We have upcoming website maintenance in just a few hours! Click here to learn more about today’s maintenance plan.


Richard Wallis

October 4, 2014 at 9:12 pm

Any progress on this.

If I do not have a patch or a fix soon we will not be able to launch online sales for our business. Which is time critical.

~Richard.


Dean

October 6, 2014 at 4:14 am

Hi,

The ticket has been actioned and is currently awaiting testing. It looks like it is functioning correctly, so I’ll ask the developer to merge this into our release cycle.


Richard Wallis

October 13, 2014 at 8:20 am

Hi,

Do you have a release date for this fix yet?

I do NEED to get this site running asap (next couple of days) as it is costing us bookings, therefore money.

Can I you send me a patch to get me going?

~Richard.


Dean

October 13, 2014 at 9:07 am

Hi Richard,

The fix has been completed and tested, and is due to be released soon (the release needs full testing before we release it).

As you need it urgently, I have wrapped up the changes into the current version and emailed you a copy, you should be able to swap the version on your site with this one (so long as you have not modified anything).

I emailed it to the email we have on file for you.


Richard Wallis

October 13, 2014 at 1:59 pm

Hi Dean,

I didn’t receive anything 🙁

I checked the email in my profile and it is correct. Was it too large for email?

~Richard.


Josh

  • Support Staff

October 13, 2014 at 3:18 pm

It’s more than likely the email attachment was too big. I’ll re-send with a download link this time.


Richard Wallis

October 21, 2014 at 4:51 am

Thank you – it appears to work 🙂

When this gets included by default, will it be obvious in the release notes?


Dean

October 21, 2014 at 6:06 am

Hi Richard,

Yes it should be in the changelog – https://eventespresso.com/wiki/ee4-changelog/

It will state something like: “A Sold Out Ticket that is Required allows other Tickets to be Purchased” though it may be reworded.


Josh

  • Support Staff

October 29, 2014 at 1:14 pm

Hi Richard,
A little update on this: Event Espresso 4.4.4.p was finally released today and it includes a fix for the issue you reported.

The support post ‘Required Ticket not available should block registration – EE4’ 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