I’m using WooCommerce 2.0 and I would like to retrieve and display the ordered product name in the myaccount.php page, alongside the order number.
So if this is the default display in myaccount.php:
ORDER DATE STATUS TOTAL ACTIONS LICENSING
#521 August 19, 2014 Completed $99.99 for 1 item VIEW
I’d like to change it to:
ORDER DATE STATUS TOTAL ACTIONS LICENSING
#521-ProductName August 19, 2014 Completed $99.99 for 1 item VIEW
Can anyone offer any suggestions on how to retrieve the order product name? I am confused on how to do this.
Thanks!
You can do it after making some changes in your my-orders.php
you need my-orders.php. Place a copy in your theme folder to make it update proof.
And in order to get more details of the order you can use the below code.
Assuming $post->ID is the id of the product you want to display the orders containing, this is what you need: