woocommerce_product_on_backorder
Action fires when an item in an order is backordered.
Usage
add_action( 'woocommerce_product_on_backorder', 'wp_kama_woocommerce_product_on_backorder_action' ); /** * Function for `woocommerce_product_on_backorder` action-hook. * * @param array $args * * @return void */ function wp_kama_woocommerce_product_on_backorder_action( $args ){ // action... }
- $args(array)
-
-
product(WC_Product)
The product that is on backorder. -
order_id(int)
The ID of the order. - quantity(int|float)
The amount of product on backorder.
-
Changelog
Since 3.0 | Introduced. |
Where the hook is called
woocommerce/includes/wc-stock-functions.php 283-290
do_action( 'woocommerce_product_on_backorder', array( 'product' => wc_get_product( $change['product']->get_id() ), 'order_id' => $order->get_id(), 'quantity' => abs( $change['from'] - $change['to'] ), ) );