Automattic\WooCommerce\Internal\PushNotifications\Triggers
StockNotificationTrigger::on_backorder
Handles the woocommerce_product_on_backorder hook.
Method of the class: StockNotificationTrigger{}
No Hooks.
Returns
null. Nothing (null).
Usage
$StockNotificationTrigger = new StockNotificationTrigger(); $StockNotificationTrigger->on_backorder( $args ): void;
- $args(array) (required)
- Backorder event data.
Changelog
| Since 10.9.0 | Introduced. |
StockNotificationTrigger::on_backorder() StockNotificationTrigger::on backorder code WC 10.9.4
public function on_backorder( array $args ): void {
$product = $args['product'] ?? null;
if ( ! $product instanceof WC_Product ) {
return;
}
$this->add_notification( $product->get_id(), StockNotification::EVENT_ON_BACKORDER );
}