1

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.

Tom F.
  • 133
  • 1
  • 11
  • This seems to be close to what you need [link](https://stackoverflow.com/questions/54904838/change-stock-email-notifications-recipient-in-woocommerce) – Buttered_Toast Dec 19 '19 at 16:02
  • Thank you for trying Buttered_Toast but that question is about filtering the e-mail recipients. Those e-mails are sent when specific conditions are met. For example when product goes out of stock or reaches the low stock limit. There must be some kind of action which is fired when conditions are met to actually send the e-mail. – Tom F. Dec 19 '19 at 16:07

1 Answers1

1

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' );
Buttered_Toast
  • 901
  • 5
  • 13