tribe_events_count_available_tickets()

Home Forums Ticket Products Event Tickets Plus tribe_events_count_available_tickets()

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1282936
    Lou Anne
    Participant

    Just wanted to point out that the stock() class method returns an empty string if no value is set, so starting in PHP7 it throws a warning here:

    foreach ( Tribe__Tickets__Tickets::get_all_event_tickets( $event->ID ) as $ticket ) {
    	$count += $ticket->stock();
    }

    I know it’s coercing an integer value, but maybe we should be explicitly converting? Not sure if that would be an issue in the future.

    #1282986
    Nico
    Member

    Thanks for the report Lou Anne!

    While I’m not a versed developer I cannot grasp the solution, but the report sounds legit and something we can ‘fix’. Let me share this with a developer and get back to you!

    Best,
    Nico

    #1283262
    Nico
    Member

    Hey Lou Anne,

    I’ve reached out and discussed this with one of our devs. Apparently the fix is not so straightforward as it seems. In some cases (ie: unlimited stock) stock function can return an empty string, and we should account for that and document the output of such functions to reflect this. Long story short, I just logged a bug ticket to get this fixed, and QA’d properly.

    If you would like to contribute with a fix for this, you can do it in Event Tickets GitHub repo: https://github.com/moderntribe/event-tickets (more info: Modern Tribe Products Engineering)

    Please let me know if there’s anything else I can do for you,
    Best,
    Nico

    #1352907
    Victor
    Member

    Hi Lou Anne!

    Just wanted to share with you that a new maintenance release (for the Week of 18 September 2017) is out, including a fix for this issue 🙂

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-18-september-2017/

    Please update the plugins and let us know if the fix works for your site.

    Best,
    Victor

    #1363306
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘tribe_events_count_available_tickets()’ is closed to new replies.