Reputation: 153
Woocommerce can send automated e-mails to admins when product stock status changes to 'outofstock'.
I would like to know which hook is fired when this happens so I can hook into it and store the time and date of this event in corresponding product meta.
I am not asking for step by step guide how to code this functionality, I am just looking for the right action to hook into.
Upvotes: 1
Views: 460
Reputation: 991
This are the hooks that you need
add_action( 'woocommerce_low_stock_notification', 'YOUR_FUNCTION' );
add_action( 'woocommerce_no_stock_notification', 'YOUR_FUNCTION' );
add_action( 'woocommerce_product_on_backorder_notification', 'YOUR_FUNCTION' );
Upvotes: 1