Hook / Function for Woocommerce Tickets

Home Forums Ticket Products Event Tickets Plus Hook / Function for Woocommerce Tickets

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1055357
    Russell
    Participant

    Hi,

    Could you tell me the hook / function to create and cancel tickets please? One of our venues requires us to confirm / cancel tickets on their server using a SOAP request when we sell or cancel tickets.

    I was planning to use this:

    global $wpdb;
    $sql = "select post_id from wp_postmeta where meta_key = '_tribe_wooticket_order' and meta_value = '".$order_id."'";
    $gettickets = $wpdb->get_results($sql);

    with this action:

    woocommerce_order_status_completed

    However, it appears that this order_status_completed is being called before the tickets are generated, so it’s unable to get any results until I change the status after the order has gone through. This isn’t ideal, so we need to hook into when the ticket is generated or cancelled.

    I’ve looked through the codex but can’t find anything that would be suitable, so if you could let me know that’d be perfect,

    Cehers
    Russ

    #1055577
    Barry
    Member

    Hi Russ,

    Tickets are generated during woocommerce_order_status_completed – so that’s the correct hook, but you’d need to use a sufficiently high priority when registering your callback.

    Ticket generation is priority 12, so something like 20 ought to work for your purposes. Does that help?

    #1076758
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hook / Function for Woocommerce Tickets’ is closed to new replies.