How to get the checkout form data from checkout page when place-order button is clicked

The place-order form button is actually called woocommerce_checkout_place_order, and the code in WC_Form_Handler passes this on to WC_Checkout process_checkout(). Here’s the relevant code. You probably want to hook: woocommerce_before_checkout_process or woocommerce_checkout_process, which happen before this code reads the items from posted data itself (although you could call WC()->checkout()->get_posted_data() yourself I think) woocommerce_after_checkout_validation, which is passed … Read more

How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?

In your PHP to call the remote server you may want to look at the http and API functions availalble in WordPress here: https://developer.wordpress.org/plugins/http-api/ For example, here’s a much easier way to get data from a remote server: $response = wp_remote_get( ‘https://api.github.com/users/blobaugh’ ); $http_code = wp_remote_retrieve_response_code( $response ); And here’s a way to post like … Read more