Site icon Hip-Hop Website Design and Development

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

I want to get the form-fields on checkout page when the user clicks on place-order button.

For this I tried different hooks, but the control does not even enter into mine block of code

I’m using the following.

add_action('woocommerce_checkout_process', 'custom_process_order');
function custom_process_order(){

   //do some your magic here
   print_r( WC()->checkout()->get_posted_data() );
   exit();
}

With this code, I got nothing.

I have checked this and this, but no success.

How can I get all the form fields when place-order buttons is clicked.

Note:

I don’t want to get them via js or JQuery to get the fields data, I want to use proper hook for this.