I'm at wits end with this now and could really use a hand.
I've added a form on the front end that asks the customer to register with their IRL user account number, I've managed to get that to store in the back end as "morello_account_number". Now I want to echo that account number on the order page in Woocommerce so that I can process orders easier without searching the customers username etc manually. I'm not really a PHP programmer, but here's my code so far:
add_filter('manage_edit-shop_order_columns', 'morello_account_number_column' );
function morello_account_number_column( $order_columns ) {
$order_columns['morello_account_number'] = "Morello Account Number";
return $order_columns;
}
add_action( 'manage_shop_order_posts_custom_column' , 'morello_placeholder' );
function morello_placeholder( $colname ) {
global $the_order; // the global order object
if( $colname == 'morello_account_number' ) {
$morello_account_number = $order->get_morello_account_number();
echo morello_account_number;
}
}
Apologies if this is super trivial - still learning. And thanks so much in advance.