Add button linked to single product page on order detail page
The woocommerce_order_details_after_order_table hook receives the WC_Order object as the $order argument. This means you can get the items from the order with $order->get_items(). That will return an Array of WC_Order_Items. From this you can get the associated product of the first item, which you can use to get its permalink, to which you can append … Read more