Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

woocommerce on order complete hook

add_action('woocommerce_thankyou', 'update_order_in_thirdparty', 10, 1);
function update_order_in_thirdparty($order_id)
{
	if (!$order_id)
		return;
  
    $order = wc_get_order( $order_id );
    $user = $order->get_user();
    if( $user ){
        // do something with the user
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #woocommerce #order #complete #hook
ADD COMMENT
Topic
Name
9+7 =