I'm trying to hook a function to the order deletion (when permanently delete is clicked from admin page) but for some reason the function isn't called. My code looks something like
add_action('woocommerce_before_delete_order_item', function($id) {
$order = new WC_Order($id);
//do some stuff with order meta data
}, 10, 1);
I tried to throw and exception inside the function but no error occurred. Can somebody help?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire