I am trying to read product value when admin click on trash for a product (image attached).
After some searching i found that woocommerce_trash_{$post_type} hook can be use for this purpose.
I found the details on class-wc-product-data-store-cpt.php line 307 @version 3.0.0
And I applied the code:
add_action('woocommerce_trash_product', 'My_custom_trash_product');
function My_custom_trash_product($product_id) {
error_log(print_r($product_id, true));
}
But it is not firing. I am using WooCommerce 6.0.0. Any advice?
