woocommerce_store_api_checkout_order_processed
Fires after the Checkout Block/Store API request has populated and validated the order.
The action runs before payment is processed, so callbacks can still act on the order on its way to the gateway.
This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action:
- To keep the interface focused (only pass
$order, not passing request data). - This also explicitly indicates these orders are from checkout block/StoreAPI.
Usage
add_action( 'woocommerce_store_api_checkout_order_processed', 'wp_kama_woocommerce_store_api_checkout_order_processed_action' );
/**
* Function for `woocommerce_store_api_checkout_order_processed` action-hook.
*
* @param \WC_Order $order Order object.
*
* @return void
*/
function wp_kama_woocommerce_store_api_checkout_order_processed_action( $order ){
// action...
}
- $order(\WC_Order)
- Order object.
Changelog
| Since 7.2.0 | Introduced. |
Where the hook is called
woocommerce_store_api_checkout_order_processed
woocommerce_store_api_checkout_order_processed
woocommerce/src/StoreApi/Routes/V1/Checkout.php 708
do_action( 'woocommerce_store_api_checkout_order_processed', $order );
woocommerce/src/StoreApi/Routes/V1/CheckoutOrder.php 160
do_action( 'woocommerce_store_api_checkout_order_processed', $this->order );