Created
August 13, 2020 11:04
-
-
Save rafsuntaskin/de982178cf35299697ed2644fb75e862 to your computer and use it in GitHub Desktop.
Woo ET Force Attendee Regeneration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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