Now the product SKU is related to the product, so when ordering and the product is not deleted it can be shown, but as soon as the product gets deleted the SKU is no longer available. Viewing orders can’t show the SKU anymore.
Leave a Reply
You must be logged in to post a comment.
Tested code
use the
woocommerce_add_order_item_meta
hook. I’ve included two versions. 1 that only supports simple products. The second version supports variations as well.Variation Support
As of 3.0.1, the woocommerce_add_order_item_meta hook has been deprecated and the new hook is woocommerce_new_order_item($item_id, $item, $order_id)