Additional Order Details on the “View Order” and “Thank You” Pages
Below is the example of additional fields on the My Account > Orders > View Order page with active Storefront theme.
woocommerce_view_order
action hook is for the View Order page, woocommerce_thankyou
is for the Order Received page. The code for your functions.php
below.
<?php
add_action( 'woocommerce_thankyou', 'misha_view_order_and_thankyou_page', 20 );
add_action( 'woocommerce_view_order', 'misha_view_order_and_thankyou_page', 20 );
function misha_view_order_and_thankyou_page( $order_id ){ ?>
<h2>Gift Order</h2>
<table class="woocommerce-table shop_table gift_info">
<tbody>
<tr>
<th>Is gift?</th>
<td><?php echo ( $is_gift = get_post_meta( $order_id, 'is_gift', true ) ) ? 'Yes' : 'No'; ?></td>
</tr>
<?php if( $is_gift ) : ?>
<tr>
<th>Gift Wrap</th>
<td><?php echo get_post_meta( $order_id, 'gift_wrap', true ); ?></td>
</tr>
<tr>
<th>Recipient name</th>
<td><?php echo get_post_meta( $order_id, 'gift_name', true ); ?></td>
</tr>
<tr>
<th>Gift message</th>
<td><?php echo wpautop( get_post_meta( $order_id, 'gift_message', true ) ); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php }
If the order is not marked as a gift, the Gift Wrap, Recipient name and Gift Message fields won’t be displayed.

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
Hi,
I Have read your tutorial about ” Additional Order Details on the “View Order” and “Thank You” Pages'” and I would like to do it with the billing address and shipping address on the ‘woocommerce_checkout_before_order_review’ ( I’m using a multistep checkout plugin).
I can display the title but not the address meta data. Do you know how to call the meta data (like : billing_first_name, billing_last_name, …) in this page ? I have try with the “order-details-customer” but it didn’t worked…
Hi,
Sorry, I’m not sure what page do you mean. Could you send me a screenshot of the page please?
Hi,
I want to show just under “adresse de facturation” (billing address) the billing address of our customer.
Not the form but a recap of his billing address and shipping before he orders.
Screenshot link : https://drive.google.com/file/d/1N0iOxk80GB8AmUb_033ZIhtnyoZYG4iV/view?usp=sharing
Hmmm, try this
Thank you so much :)