Sending the Tickets Email on Processing Status

Home Forums Ticket Products Event Tickets Plus Sending the Tickets Email on Processing Status

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #164186
    Jack
    Participant

    It seems as though the tickets email is only sent when the WooCommerce Order status is set to Completed. We need the tickets to be sent as soon as the payment is accepted, therefore when the status changes from Pending to Processing. Is there a way to do that?

    #166195
    Barry
    Member

    Hi!

    Yes that should be possible. It is indeed set to do this when an order completes by leveraging WooCommerce’s woocommerce_order_status_completed action – but you can change this and use any other action you feel is suitable – so in outline something like:

    add_action( 'init', 'change_wootickets_ticket_gen_action' );
    
    function change_wootickets_ticket_gen_action() {
        $instance = TribeWooTickets::get_instance();
        $callback = array( $instance, 'generate_tickets';
    
        remove_action( 'woocommerce_order_status_completed', $callback, 12 );
        add_action( 'target_action', $callback );
    }

    You’d need to replace target_action with whatever works in your case – possibly woocommerce_order_status_pending_to_processing – but we’d need to leave you to experiment and research that angle.

    Good luck 🙂

    #169425
    becauseisaidiwould
    Participant

    Hi Barry,

    Is this code that you would add to your functions.php file? I tried it but it broke my site.

    #169460
    becauseisaidiwould
    Participant

    Is woocommerce_order_status_pending_to_processing something that you have to write yourself? I am not sure what you mean by experiment and research yourself.

    #723195
    Barry
    Member

    Hi: I’m very sorry we missed these follow up questions. That was, unfortunately, due to a bug in our forum software (which only notified us of updates when the original poster added a new reply). Owing to the amount of time that’s elapsed I will now close this thread and I’d ask that if you still need help you create a fresh thread: one of the team will then be only too happy to assist 🙂

    Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Sending the Tickets Email on Processing Status’ is closed to new replies.