woocommerce_store_api_checkout_order_processed
Fires before an order is processed by the Checkout Block/Store API.
This hook informs extensions that $order has completed processing and is ready for payment.
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 341
do_action( 'woocommerce_store_api_checkout_order_processed', $this->order );
woocommerce/src/StoreApi/Routes/V1/CheckoutOrder.php 158
do_action( 'woocommerce_store_api_checkout_order_processed', $this->order );