Home › Forums › Ticket Products › Event Tickets Plus › change priority on generate_Tickets
- This topic has 5 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
August 8, 2013 at 9:41 pm #59635
infamia
ParticipantHello Barry et al.
First, thanks for yoru help on removing ticket email (https://theeventscalendar.com/support/forums/topic/remove-tickets-email/#post-58586 ). This worked.
Now I’m having a related problem: when I try to add the emails to the “order completed’ email, it doesn’t work. Hoewver if I resend the “order completed” email, it works! I have a feeling this is because the email goes out before tickets get generated.
Do you have a snippet perhaps to reprioritize ticket generation? essentially change wootickets/classes/class-wootickets.php line 101
from:
add_action( ‘woocommerce_order_status_completed’, array( $this, ‘generate_tickets’ ), 12 );to:
add_action( ‘woocommerce_order_status_completed’, array( $this, ‘generate_tickets’ ), 0 );I can hard-wire it and it works…
August 8, 2013 at 10:01 pm #59637infamia
ParticipantWoudl this code work:
remove_action( 'woocommerce_order_status_completed', array(TribeWooTickets::get_instance(), 'generate_tickets'));
add_action( 'woocommerce_order_status_completed', array(TribeWooTickets::get_instance(),'generate_tickets'), 0 );
in functions.phpAugust 9, 2013 at 5:38 am #59660Barry
MemberYes you can basically reorder actions in that way except when removing an action you must specify the original priority, unless of course it happens to be the default priority.
August 9, 2013 at 6:36 am #59673infamia
ParticipantHey Barry.
It seems to work. I changed the code to
//*reprioritize ticket generation
remove_action( 'woocommerce_order_status_completed', array(TribeWooTickets::get_instance(), 'generate_tickets'), 12 );
add_action( 'woocommerce_order_status_completed', array(TribeWooTickets::get_instance(),'generate_tickets'), 0 );
Thanks again for your continued help.
August 10, 2013 at 6:10 am #59828Barry
MemberNo problem at all, thank you for checking in with the final solution – could definitely be useful for others here 🙂
July 7, 2015 at 6:27 am #979445Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘change priority on generate_Tickets’ is closed to new replies.
