Skip to content

Instantly share code, notes, and snippets.

@rafsuntaskin
Created August 13, 2020 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafsuntaskin/de982178cf35299697ed2644fb75e862 to your computer and use it in GitHub Desktop.
Save rafsuntaskin/de982178cf35299697ed2644fb75e862 to your computer and use it in GitHub Desktop.
Woo ET Force Attendee Regeneration
<?php
//add Order action
add_filter( 'woocommerce_order_actions', 'rt_add_regenerate_action_for_et' );
function rt_add_regenerate_action_for_et( $actions ) {
$actions['tribe_force_regenerate_ticket'] = __( 'Regenerate Attendees' );
return $actions;
}
add_action( 'woocommerce_order_action_tribe_force_regenerate_ticket', 'rt_regenerate_tickets_by_order' );
/**
* Regenerate action for missing attendees
*
* @param $order WC_Order
*/
function rt_regenerate_tickets_by_order( $order ) {
tribe( 'tickets-plus.commerce.woo' )->generate_tickets( $order->get_id() );
$order->add_order_note('Force regenerated attendees');
}
@rafsuntaskin
Copy link
Author

Adds a new action to force regenerate attendees if they are not showing in the attendee list.

For the orders where the generate attendees is not showing up you can force regenerate them for the Order edit screen:

http://p.tri.be/TBQ3dh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment