Show track & trace field in Woocommerce quick order preview after wc-order-preview-note

In Woocommerce admin order list on the preview page i'm trying to add after "note" my "track & trace". I'm looking for documentation where wc-order-preview-note is registered to add it after but I don't seem to be able to find it. How it looks like now How it should look like It has to check on the detail page what is fild in on "track & trace" <?php // Weergave van het Track & Trace veld in WooCommerce Admin Order Details add_action('woocommerce_admin_order_data_after_order_details', function ($order) { woocommerce_wp_text_input(array( 'id' => '_track_trace_field', 'label' => __('Track & Trace:', 'text-domain'), 'placeholder' => __('Voer trackingnummer in', 'text-domain'), 'description' => __('Voer het trackingnummer voor de bestelling in.', 'text-domain'), 'value' => get_post_meta($order->get_id(), '_track_trace_field', true), 'desc_tip' => true, )); }, 10, 1); // Opslaan van het Track & Trace veld add_action('woocommerce_process_shop_order_meta', function ($post_id, $post) { if (!empty($_POST['_track_trace_field'])) { update_post_meta($post_id, '_track_trace_field', sanitize_text_field($_POST['_track_trace_field'])); } }, 10, 2); ?> I have changed it to the information given in Display custom data on Woocommerce admin order preview but as you can see it's on the button now and not under "notitie" like requested. <?php // Weergave van het Track & Trace veld in WooCommerce Admin Bestelgegevens add_action('woocommerce_admin_order_data_after_order_details', function ($order) { woocommerce_wp_text_input(array( 'id' => '_track_trace_field', 'label' => __('Track & Trace:', 'text-domain'), 'placeholder' => __('Voer trackingnummer in', 'text-domain'), 'description' => __('Voer het trackingnummer voor de bestelling in.', 'text-domain'), 'value' => get_post_meta($order->get_id(), '_track_trace_field', true), 'desc_tip' => true, )); }, 10, 1); // Opslaan van het Track & Trace veld add_action('woocommerce_process_shop_order_meta', function ($post_id, $post) { if (!empty($_POST['_track_trace_field'])) { update_post_meta($post_id, '_track_trace_field', sanitize_text_field($_POST['_track_trace_field'])); } }, 10, 2); // Voeg Track & Trace Data toe aan de Order Preview add_filter('woocommerce_admin_order_preview_get_order_details', 'custom_add_track_trace_to_order_preview', 10, 2); function custom_add_track_trace_to_order_preview($order_details, $order) { $track_trace = get_post_meta($order->get_id(), '_track_trace_field', true); if ($track_trace) { $order_details['track_trace'] = $track_trace; // Voeg de Track & Trace informatie toe } return $order_details; } // Toon de Track & Trace informatie in de order preview onder de Notities add_action('woocommerce_admin_order_preview_end', 'custom_display_order_data_in_admin'); function custom_display_order_data_in_admin() { ?> <# if ( data.track_trace ) { #> <div class="order_note wc-admin-note wc-admin-note-track-trace"> <strong><?php _e('Track & Trace:', 'text-domain'); ?></strong> <div class="note_content">{{ data.track_trace }}</div> </div> <# } #> <?php } ?> GITHUB INFORMATION: GITHUB LINK I have found out that the class is build in class-wc-admin-list-table-orders.php but when I check it, it shows hooks and way shorter information. The link I found to someones github the class WC-ORDER-PREVIEW-NOTE was in the past (5 years ago) there directly so I could have added it under it. But it isn't there anymore. public function order_preview_template() Anyone has a direct solution to this? Thank you!

Comment (0)

You’ll be in good company