stock tickets on event page

Home Forums Ticket Products Event Tickets Plus stock tickets on event page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #963261
    Pasquale
    Participant

    Hi I need exactly this: https://theeventscalendar.com/support/forums/topic/stock-on-event-page/
    i.e. tho show # of tickets sold & left, but I’m using wootickets and not edd ticket and I can’t understand what part of the code need the fixing. Can you help me, please?

    thanks

    #963508
    Brook
    Participant

    Howdy Pasquale,

    That’s a good question. We do have one function available that can make half of what you want to do easy enough. That is tribe_events_count_available_tickets(). That allows you to easily show how many tickets are still available.I jsut wrote a second function to complement that one, which will show how many tickets have been sold. Copy/paste the following into your theme’s functions.php file, then you can call the new function tribe_events_count_sold_tickets() just like you would the other funciton to show how many tickets have sold.

    https://gist.github.com/elimn/bf36f50c7ca2a4e50c9e

    Does that all make sense? Does that work for you?
    Cheers!

    – Brook

    #963609
    Pasquale
    Participant

    Hi Brook, It works. thank you!

    Now I’m trying to manage another problem (I’ve opened another ticket: https://theeventscalendar.com/support/forums/topic/ticket-stock-increases-as-people-purchase-tickets/#post-963577) since it seems there’s something wrong with the decreasing of total stocks when a customer buys a ticket. Brian answered that, maybe you can have a look too!

    #963631
    Brook
    Participant

    Howdy Pasquale,

    I am happy to hear that worked.

    Brian is spot on. In simple terms the problem you are facing is a side-effect of how WooCommerce itself handles stock counts. When any product is purchased, whether it be tickets or otherwise, WooCommerce has these statuses for their orders. In your case it sounds like the status is Pending payment. As noted in Woo’s documentation there, orders which are pending payment do not reduce the stock count.

    There is good reason for that. For example, if Woo reduced stock counts while payment was pending a malicious person could purchase all tickets from your website with bogus payment information. Thus they could make every single ticket and product appear as out of stock, and prevent you from selling anything or getting paid.

    For your specific needs, I am not aware of any upcoming changes to our plugin or WooCommerce that will fix things. Most people in your shoes will charge credit cards upon an order, but then refund those orders if the event is cancelled. This does have some drawbacks, but is the typical way of things and it is how WooCommerce is designed to operate. You might be able to modify this behavior, but I am not enough of an expert on WooCommerce to say, I am only an expert on WooCommerce Tickets. You should consult their documentation and support channels if this is something you are interested in modifying.

    Does that all make sense?

    Cheers!
    – Brook

    #963847
    Pasquale
    Participant

    Hi Brook,

    but if it would be so woocommerce should be doing the same with bank transfer method…. and it doesn’t! when a customer choose the bank transfer the stock decreases even if there is no real payment yet!

    The problem is surely in the connection between WC and PayPal, I’m doing some changes in WC and on PP account, following Brian’s suggestions, I’ll update that ticket too.

    thanks and br,

    #964106
    Brook
    Participant

    Thanks for the update Pasquale! I think I understand. Since Brian has already responded I will just defer to his response.

    Usually we strive to keep each topic to a single issue. As you have marked the original issue from this topic resolved, and Brian is doing a great job of helping you in the other one, I am going to archive this topic.

    Thanks for posting!

    – Brook

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘stock tickets on event page’ is closed to new replies.