I want to show Air Waybill on customer ‘view order’ page of woocommerce
I create a custome field named AWB , value xxx

How to show them on the view order page of woocommece
Thank you


Solution:

You can override templates->order->order-detals.php to edit view order page. just print_r($item_meta); below the $item_meta->display(); and you will get get an array including your custom field value on view order page. Now fetch your custom field data from the array.

Or Use this query below $item_meta->display();

$pid=$item_meta->meta['_product_id'][0];
$custom_val=$wpdb->get_var("select meta_value from wp_postmeta where post_id = {$pid} AND meta_key='AWB'"); echo "Air Waybill: ".$custom_val;

Note: AWB =custom field name


Related Wordpress search:

, , , , , ,

Wordpress related questions and answers: