Invoice information on the woocoommerce_thankyou page is curled by a web service. If the user does not see this page for any reason, how can the storage operation be performed? Can invoice storage action be changed in any other way?
add_action( 'woocommerce_thankyou', 'club_add_factor', 10, 1 );
function club_add_factor( $order_id ) {
if ( ! $order_id ) {
return;
}
/* Get order info */
$order = new WC_Order( $order_id );
$userID = $order->get_customer_id();
$api = new Club( $userID );
// something ...
}
2
Answers
Thanks bro ! I solved it with 'woocommerce_order_status_processing' action. I used it :
You are right, "woocommerce_thankyou" handles the following hooks collectively. But when you are not landing on thankyou page, you can use on-hold or processing instead.