Retrieve deleted product ID
-
Hello everyone,
I’m currently trying to improve the integration of one of my plugins into WooCommerce. Specifically, I’m trying to display the product name of a deleted product inside the
woocommerce_after_order_itemmeta
action.I noticed that the hook passes a
WC_Order_Item_Product
object, and it even has aget_product_id()
method, but it always returns 0 for deleted products. I happen to store the product ID in a table of my own, but if the order contains multiple different product ID’s I can’t be sure which ones belong, and which don’t.So to keep it short: Is there any way to retrieve the product ID of a deleted WooCommerce Product?
PS: The product is in fact, deleted, not trashed!
- The topic ‘Retrieve deleted product ID’ is closed to new replies.