H
H
hippy11432020-05-12 19:52:10
WooCommerce
hippy1143, 2020-05-12 19:52:10

How to display custom data from an order in the woocomerce admin panel, regardless of registration on the site?

The situation is this:
There is a function that should display custom fields (already created and working) in the admin->orders:
add_action( 'woocommerce_admin_order_data_after_billing_address', 'organization_checkout_field_display_admin_order_meta', 10, 1 );
function organization_checkout_field_display_admin_order_meta($order) {
$user_id = $order->get_user_id();
$user_id_company = get_user_meta( $user_id, 'company', 'on' );
if($user_id_company) {
echo '

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question