Checkout: Action – checkout_process_order_X

Description

The checkout_process_order_X action hook runs after the billing step of checkout, when the customer has chosen the payment method to pay with.

X in the hook name is replaced with the slug of your payment method. So if the slug of your payment method is “mypmethod”, then the hook will be checkout_process_order_mypmethod.

Usage

add_action('checkout_process_order_mypmethod', 'process_order', 10, 3);

Arguments

  • $order – An Object with all the data of the order
  • $user – An Object with all the data of the user (if available, logged in users only)
  • $params – Additional parameters which may be passed through

Example

function process_order($order = null, $user = null, $params = null) {

// You can now output a payment form.
// Either one that will be filled in and submitted or even a form with hidden fields that submits with Javascript

?>

<form action="" method="">
<!-- payment form fields here -->
</form>

<?php
}

add_action('checkout_process_order_mypmethod', 'process_order', 10, 3);

 

Earn Money by Referring People

Refer customers to us with your affiliate link and earn commission on sales from your link.

Get Started

Pin It on Pinterest

%d bloggers like this: