Tom F.
Tom F.

Reputation: 153

Woocommerce store date and time when the product went out of stock

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

Answers (1)

Buttered_Toast
Buttered_Toast

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

Related Questions