I want to display the item unit price (include sale price,and regular price ) in the customer email and customer view order page.
In woocommerce order line item object, you are only can see the item line subtotal, subtotal , qty..etc. But it doesn't show the original price unit price (including regular price and sale price) in the data. At most I can get the unit price by adding the discounted amount and line subtotal. But it is no way I know if the item is in sale or not as well as the responding price.
Right now I can use the following codes to get the unit price in order item:
$product = $item->get_product();
$product->get_price_html();
The problem with this get_price_html() is display the real time product price. Which means if I changed the product price after sometime, then the price in previous order details will changed as well. This will caused a lot of confusion when someone view the older order.
So how can I get the original unit price of the line item in order details?